Skip to content
This repository has been archived by the owner on Jun 21, 2023. It is now read-only.

Commit

Permalink
Fix skipping of tests (polkadot-js#5392)
Browse files Browse the repository at this point in the history
  • Loading branch information
jacogr authored May 30, 2021
1 parent 4de48a8 commit 42d7d4b
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 21 deletions.
11 changes: 11 additions & 0 deletions jest-slow.config.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// Copyright 2017-2021 @polkadot/apps authors & contributors
// SPDX-License-Identifier: Apache-2.0

const config = require('./jest.config.cjs');

module.exports = {
...config,
displayName: 'all-tests',
globalSetup: './jest/globalSetup.ts',
globalTeardown: './jest/globalTeardown.ts'
};
22 changes: 4 additions & 18 deletions jest.config.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ const config = require('@polkadot/dev/config/jest.cjs');

const findPackages = require('./scripts/findPackages.cjs');

const defaultConfig = {
module.exports = {
...config,
moduleNameMapper: {
...(
findPackages()
Expand All @@ -22,22 +23,7 @@ const defaultConfig = {
'\\.(md)$': '<rootDir>/jest/mocks/empty.js'
},
setupFilesAfterEnv: ['<rootDir>/jest/jest-setup.ts'],
testEnvironment: 'jsdom',
testTimeout: 25000,
transformIgnorePatterns: ['/node_modules/(?!@polkadot|@babel/runtime/helpers/esm/)']
};

module.exports = {
...config,
projects: [
{
...defaultConfig,
displayName: 'all-tests',
globalSetup: './jest/globalSetup.ts',
globalTeardown: './jest/globalTeardown.ts'
},
{
...defaultConfig,
displayName: 'fast-tests'
}
],
testTimeout: 25000
};
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,9 @@
"lint:css": "stylelint './packages/**/src/**/*.tsx'",
"postinstall": "polkadot-dev-yarn-only",
"postinstall:electron": "electron-builder install-app-deps",
"test": "echo 'tests skipped'",
"test:REPLACE": "polkadot-dev-run-test --selectProjects=fast-tests --silent --testPathIgnorePatterns slow --testNamePattern='^((?!--SLOW--).)*$'",
"test:all": "polkadot-dev-run-test --selectProjects=all-tests --silent",
"test:skipped": "echo 'tests skipped'",
"test": "polkadot-dev-run-test --runInBand --testPathIgnorePatterns slow --testNamePattern='^((?!--SLOW--).)*$'",
"test:all": "polkadot-dev-run-test --runInBand --config ./jest-slow.config.cjs",
"test:one": "polkadot-dev-run-test",
"start": "yarn clean && cd packages/apps && yarn webpack-cli serve --config webpack.serve.cjs --port 3000",
"start:electron": "yarn clean:electronBuild && concurrently 'yarn build:devElectronMain && cd packages/apps-electron && electron ./build/electron.js' 'yarn build:devElectronRenderer'"
Expand Down

0 comments on commit 42d7d4b

Please sign in to comment.