mirror of
https://github.com/EnixCoda/Gitako.git
synced 2026-03-11 08:54:44 +00:00
test: divide cases according to parallelizibility
This commit is contained in:
parent
863260a454
commit
345c5cec99
8 changed files with 11 additions and 4 deletions
|
|
@ -4,8 +4,6 @@ describe(`in Gitako project page`, () => {
|
|||
beforeAll(() => page.goto('https://github.com/EnixCoda/Gitako/commits/develop'))
|
||||
|
||||
it('should not break go back in history', async () => {
|
||||
// temporarily skip this test as GitHub has unexpected PJAX behaviors
|
||||
return
|
||||
for (let i = 0; i < 3; i++) {
|
||||
const commitLinks = await page.$$(
|
||||
`#js-repo-pjax-container .TimelineItem-body ol li > div:nth-child(1) a[href*="/commit/"]`,
|
||||
|
|
@ -61,7 +61,7 @@ module.exports = {
|
|||
// globals: {},
|
||||
|
||||
// The maximum amount of workers used to run your tests. Can be specified as % or a number. E.g. maxWorkers: 10% will use 10% of your CPU amount + 1 as the maximum worker number. maxWorkers: 2 will use a maximum of 2 workers.
|
||||
maxWorkers: 1, // more than 1 workers may make tabs in background and never renders Gitako's file items.
|
||||
maxWorkers: 8,
|
||||
|
||||
// An array of directory names to be searched recursively up from the requiring module's location
|
||||
// moduleDirectories: [
|
||||
|
|
|
|||
7
jest.non.parallel.config.js
Normal file
7
jest.non.parallel.config.js
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
const baseConfig = require('./jest.config')
|
||||
|
||||
module.exports = {
|
||||
...baseConfig,
|
||||
maxWorkers: 1,
|
||||
testMatch: ['**/__tests__/non-parallel-cases/*.ts?(x)'],
|
||||
}
|
||||
|
|
@ -14,7 +14,9 @@
|
|||
"postinstall": "rm -rf node_modules/@types/react-native && node scripts/fix-pjax-api",
|
||||
"build": "VERSION=v$(node scripts/get-version.js) NODE_ENV=production webpack",
|
||||
"roll": "make release",
|
||||
"test": "NODE_ENV=test jest"
|
||||
"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"
|
||||
},
|
||||
"dependencies": {
|
||||
"@primer/components": "^22.0.2",
|
||||
|
|
|
|||
Loading…
Reference in a new issue