Fix skipping of tests (#5392)

This commit is contained in:
Jaco 2021-05-30 11:01:27 +03:00 committed by GitHub
parent 4de48a84f2
commit 42d7d4b9f4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 18 additions and 21 deletions

11
jest-slow.config.cjs Normal file
View File

@ -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'
};

View File

@ -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()
@ -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
};

View File

@ -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'"