test: move test files

This commit is contained in:
EnixCoda 2021-08-23 11:13:26 +08:00
parent 5100c7b98d
commit 05ebb8d092
14 changed files with 28 additions and 22 deletions

View file

@ -1,4 +1,4 @@
import { expectToFind, expectToNotFind, sleep, waitForLegacyPJAXRedirect } from '../utils'
import { expectToFind, expectToNotFind, sleep, waitForLegacyPJAXRedirect } from '../../utils'
describe(`in Gitako project page`, () => {
beforeAll(() => page.goto('https://github.com/EnixCoda/Gitako/commits/develop'))

View file

@ -1,4 +1,4 @@
import { expectToFind, expectToNotFind, sleep, waitForLegacyPJAXRedirect } from '../utils'
import { expectToFind, expectToNotFind, sleep, waitForLegacyPJAXRedirect } from '../../utils'
describe(`in Gitako project page`, () => {
beforeAll(() => page.goto('https://github.com/EnixCoda/Gitako/tree/develop/src'))

View file

@ -4,8 +4,8 @@ import {
patientClick,
selectFileTreeItem,
sleep,
waitForLegacyPJAXRedirect,
} from '../utils'
waitForLegacyPJAXRedirect
} from '../../utils'
describe(`in Gitako project page`, () => {
beforeAll(() => page.goto('https://github.com/EnixCoda/Gitako/tree/develop/src'))

View file

@ -5,8 +5,8 @@ import {
patientClick,
selectFileTreeItem,
sleep,
waitForPJAXAPIRedirect,
} from '../utils'
waitForPJAXAPIRedirect
} from '../../utils'
describe(`in Gitako project page`, () => {
beforeAll(() => page.goto('https://github.com/EnixCoda/Gitako'))

View file

@ -4,7 +4,7 @@ import {
expectToNotFind,
scroll,
selectFileTreeItem
} from '../utils'
} from '../../utils'
describe(`in Gitako project page`, () => {
beforeAll(() => page.goto('https://github.com/EnixCoda/Gitako'))

View file

@ -1,8 +1,8 @@
/**
* Make sure some basic behaviors of puppeteer assertions
* Confirm basic behaviors of puppeteer assertions
*/
import { expectToFind, expectToNotFind } from '../utils'
import { expectToFind, expectToNotFind } from '../../utils'
describe(`in random page`, () => {
beforeAll(() => page.goto('https://google.com'))

View file

@ -3,7 +3,7 @@ import {
selectFileTreeItem,
sleep,
waitForLegacyPJAXRedirect
} from '../utils'
} from '../../utils'
describe(`in Gitako project page`, () => {
beforeAll(() => page.goto('https://github.com/EnixCoda/Gitako/tree/develop/src'))

View file

@ -1,4 +1,4 @@
import { expectToNotFind } from '../utils'
import { expectToNotFind } from '../../utils'
describe(`in GitHub homepage`, () => {
beforeAll(() => page.goto('https://github.com'))

View file

@ -1,4 +1,4 @@
import { expectToFind } from '../utils'
import { expectToFind } from '../../utils'
describe(`in Gitako project page`, () => {
beforeAll(() => page.goto('https://github.com/EnixCoda/Gitako/pull/71'))

View file

@ -0,0 +1,7 @@
const baseConfig = require('../jest.config')
module.exports = {
...baseConfig,
maxWorkers: 1,
testMatch: [...baseConfig.testMatch, '**/__tests__/cases/non-parallel/*.ts?(x)'],
}

View file

@ -0,0 +1,6 @@
const baseConfig = require('../jest.config')
module.exports = {
...baseConfig,
testMatch: [...baseConfig.testMatch, '**/__tests__/cases/parallel/*.ts?(x)'],
}

View file

@ -141,7 +141,7 @@ module.exports = {
// testLocationInResults: false,
// The glob patterns Jest uses to detect test files
testMatch: ['**/__tests__/cases/*.ts?(x)', '**/?(*.)+(spec|test).ts?(x)'],
testMatch: ['**/?(*.)+(spec|test).ts?(x)'],
// An array of regexp pattern strings that are matched against all test paths, matched tests are skipped
testPathIgnorePatterns: ['/node_modules/', '.d.ts$', '<rootDir>/vscode-icons/'],

View file

@ -1,7 +0,0 @@
const baseConfig = require('./jest.config')
module.exports = {
...baseConfig,
maxWorkers: 1,
testMatch: ['**/__tests__/non-parallel-cases/*.ts?(x)'],
}

View file

@ -15,8 +15,8 @@
"build": "VERSION=v$(node scripts/get-version.js) NODE_ENV=production webpack",
"roll": "make release",
"test": "yarn run test:parallel && yarn run test:non-parallel",
"test:parallel": "NODE_ENV=test jest",
"test:non-parallel": "NODE_ENV=test jest --config jest.non.parallel.config.js"
"test:parallel": "NODE_ENV=test jest --config __tests__/jest.parallel.config.js",
"test:non-parallel": "NODE_ENV=test jest --config __tests__/jest.non-parallel.config.js"
},
"dependencies": {
"@primer/components": "^22.0.2",