fix: extends timeout for timed out test (#208)

* fix: extends timeout for timed out test

* fix: add dependent script to turbo test

* fix: disable threading for test

* fix: add timeout to vitest config

* chore: remove test-ci script

* fix: extends timeout to validator vitest config

* chore: conditionally disabling vitest threading on CI
This commit is contained in:
Fazza Razaq Amiarso 2022-11-25 20:37:23 +07:00 committed by GitHub
parent 7d05ecc580
commit 0853ca3b8f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 21 additions and 10 deletions

View file

@ -28,5 +28,5 @@ jobs:
- run: npm ci
- run: npm run clean
- run: npm run check
- run: npm run test-ci
- run: npm run test
- run: npm run lint

View file

@ -28,8 +28,7 @@
"patch": "npm version patch -w",
"minor": "npm version minor -w",
"major": "npm version major -w",
"publish": "turbo run lint build test && npm publish --access public -w",
"test-ci": "npm run test --workspaces --if-present"
"publish": "turbo run lint build test && npm publish --access public -w"
},
"license": "ISC",
"workspaces": [

View file

@ -1,5 +1,8 @@
import { defineConfig } from 'vitest/config';
export default defineConfig({
test: {},
test: {
testTimeout: 30000,
threads: !process.env.CI,
},
});

View file

@ -9,9 +9,13 @@ describe('Example Tests', () => {
});
describe('Component test', async () => {
it('example component should not be empty', async () => {
component = await getComponentOutput('./Validator.astro');
expect(component.html).not.to.equal('\n');
});
it(
'example component should not be empty',
async () => {
component = await getComponentOutput('./Validator.astro');
expect(component.html).not.to.equal('\n');
},
{ timeout: 10000, retry: 3 }
);
});
});

View file

@ -1,5 +1,7 @@
import { defineConfig } from 'vitest/config';
export default defineConfig({
test: {},
test: {
testTimeout: 30000,
},
});

View file

@ -17,7 +17,10 @@
"dev": {
"cache": false
},
"test": {},
"test": {
"env": ["CI"],
"outputs": []
},
"check": {},
"clean": {}
}