-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(vitest): updated config - project separated test calls
- Loading branch information
1 parent
749d027
commit 9b69b72
Showing
9 changed files
with
94 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"version":"2.1.5","results":[["packages/playground:packages/playground/src/demo/index.test.js",{"duration":0,"failed":false}]]} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,10 @@ | ||
import { defineProject } from 'vitest/config'; | ||
|
||
export default defineProject({ | ||
cacheDir: '../.cache/vitest-observables', | ||
test: { | ||
cacheDir: '../.cache/vitest', | ||
setupFiles: ['../../setup.js'], | ||
environment: 'happy-dom' | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
{ | ||
"name": "@rxjs-collection/playground", | ||
"version": "1.0.12", | ||
"description": "rxjs playground", | ||
"license": "MIT", | ||
"contributors": [ | ||
{ | ||
"name": "Stephan Gerbeth", | ||
"email": "[email protected]" | ||
} | ||
], | ||
"type": "module", | ||
"main": "src/index.js", | ||
"files": [ | ||
"./src/*" | ||
], | ||
"scripts": { | ||
"release": "npx semantic-release", | ||
"dev": "npx vitest" | ||
}, | ||
"imports": { | ||
"#observables/*": "../observables/src/*", | ||
"#operators/*": "../operators/src/*", | ||
"#mocks/*": "../mocks/*" | ||
}, | ||
"dependencies": { | ||
"@rxjs-collection/observables": "*", | ||
"@rxjs-collection/operators": "*", | ||
"rxjs": "7.8.1" | ||
}, | ||
"devDependencies": { | ||
"node-fetch": "3.3.2" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { delay, from } from 'rxjs'; | ||
import { describe, test } from 'vitest'; | ||
|
||
describe('playground stephan', () => { | ||
test('basics', async () => { | ||
const s = from([1, 2, 3, 4, 5, 6, 7, 8, 9]) | ||
.pipe(delay(4000)) | ||
.subscribe(e => { | ||
console.log(e); | ||
// s.unsubscribe(); | ||
}); | ||
await new Promise(done => setTimeout(done, 5000)); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { defineProject } from 'vitest/config'; | ||
|
||
export default defineProject({ | ||
cacheDir: '../.cache/vitest-playground', | ||
test: { | ||
cacheDir: '../.cache/vitest', | ||
setupFiles: ['../../setup.js'], | ||
testTimeout: 10000, | ||
environment: 'happy-dom' | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,18 @@ | ||
export default ['packages/**/vitest.config.js']; | ||
// export default ['packages/**/vitest.config.js']; | ||
|
||
import { readFileSync } from 'node:fs'; | ||
import { defineWorkspace } from 'vitest/config'; | ||
|
||
const pkg = JSON.parse(readFileSync('./package.json', 'utf-8')); | ||
|
||
export default defineWorkspace([ | ||
...pkg.workspaces | ||
.filter(name => !['scripts'].includes(name)) | ||
.map(name => ({ | ||
extends: `./${name}/vitest.config.js`, | ||
test: { | ||
root: `./${name}`, | ||
name | ||
} | ||
})) | ||
]); |