Skip to content

Commit 87cebfe

Browse files
Merge pull request #105 from basics/feature/optimization
Feature/optimization
2 parents 244685f + 5511ec7 commit 87cebfe

File tree

12 files changed

+179
-15
lines changed

12 files changed

+179
-15
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@ node_modules
44

55
/coverage
66
/.github_old
7+
/.cache

.vscode/extensions.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
"formulahendry.auto-rename-tag",
1515
"naumovs.color-highlight",
1616
"humao.rest-client",
17-
"techer.open-in-browser"
17+
"techer.open-in-browser",
18+
"vitest.explorer"
1819
]
1920
}

package-lock.json

Lines changed: 125 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,16 @@
2121
"release": "npm run release --workspaces",
2222
"release:proof": "npx dotenv-cli -- npm run release -- -- --dry-run",
2323
"test": "vitest",
24+
"test:ui": "vitest --ui",
25+
"test:project:observables": "vitest --project packages/observables",
26+
"test:project:operators": "vitest --project packages/operators",
27+
"test:project:playground": "vitest --project packages/playground",
2428
"coverage": "vitest run --coverage"
2529
},
2630
"workspaces": [
2731
"packages/operators",
28-
"packages/observables"
32+
"packages/observables",
33+
"packages/playground"
2934
],
3035
"devDependencies": {
3136
"@commitlint/config-conventional": "19.6.0",
@@ -36,21 +41,22 @@
3641
"@semantic-release/npm": "12.0.1",
3742
"@semantic-release/release-notes-generator": "14.0.1",
3843
"@vitest/coverage-v8": "2.1.5",
44+
"@vitest/eslint-plugin": "1.1.10",
45+
"@vitest/ui": "^2.1.5",
3946
"commitlint": "19.6.0",
4047
"eslint": "9.15.0",
4148
"eslint-config-prettier": "9.1.0",
4249
"eslint-plugin-no-secrets": "1.1.2",
4350
"eslint-plugin-perfectionist": "4.0.3",
4451
"eslint-plugin-prettier": "5.2.1",
4552
"eslint-plugin-security": "3.0.1",
46-
"@vitest/eslint-plugin": "1.1.10",
4753
"fetch-mock": "12.2.0",
4854
"happy-dom": "15.11.6",
4955
"husky": "9.1.7",
5056
"lint-staged": "15.2.10",
5157
"prettier": "3.3.3",
5258
"semantic-release": "24.2.0",
5359
"semantic-release-monorepo": "8.0.2",
54-
"vitest": "2.1.5"
60+
"vitest": "^2.1.5"
5561
}
5662
}

packages/observables/vitest.config.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
import { defineProject } from 'vitest/config';
22

33
export default defineProject({
4+
cacheDir: '../.cache/vitest-observables',
45
test: {
6+
cacheDir: '../.cache/vitest',
7+
setupFiles: ['../../setup.js'],
58
environment: 'happy-dom'
69
}
710
});

packages/operators/vitest.config.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
import { defineProject } from 'vitest/config';
22

33
export default defineProject({
4+
cacheDir: '../.cache/vitest-operators',
45
test: {
6+
cacheDir: '../.cache/vitest',
57
setupFiles: ['../../setup.js'],
68
testTimeout: 10000,
79
environment: 'happy-dom'

packages/playground/package.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@
1515
"./src/*"
1616
],
1717
"scripts": {
18-
"release": "npx semantic-release"
18+
"release": "npx semantic-release",
19+
"dev": "npx vitest"
1920
},
2021
"imports": {
2122
"#observables/*": "../observables/src/*",
@@ -26,5 +27,8 @@
2627
"@rxjs-collection/observables": "*",
2728
"@rxjs-collection/operators": "*",
2829
"rxjs": "7.8.1"
30+
},
31+
"devDependencies": {
32+
"node-fetch": "3.3.2"
2933
}
3034
}
Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
1-
import { from } from 'rxjs';
1+
import { delay, from } from 'rxjs';
22
import { describe, test } from 'vitest';
33

44
describe('playground stephan', () => {
5-
test('basics', () => {
6-
from([1, 2, 3]).subscribe(e => console.log(e));
5+
test('basics', async () => {
6+
const s = from([1, 2, 3, 4, 5, 6, 7, 8, 9])
7+
.pipe(delay(4000))
8+
.subscribe(e => {
9+
console.log(e);
10+
// s.unsubscribe();
11+
});
12+
await new Promise(done => setTimeout(done, 5000));
713
});
814
});

packages/playground/vitest.config.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
import { defineProject } from 'vitest/config';
22

33
export default defineProject({
4+
cacheDir: '../.cache/vitest-playground',
45
test: {
6+
cacheDir: '../.cache/vitest',
57
setupFiles: ['../../setup.js'],
68
testTimeout: 10000,
79
environment: 'happy-dom'

sonar-project.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ sonar.organization=basics
44
sonar.cpd.exclusions=./packages/**/*.test.js
55
sonar.javascript.lcov.reportPaths=./coverage/lcov.info
66
sonar.test.inclusions=**/*.test.js
7+
sonar.coverage.exclusions=vitest.workspace.js
78

89
# This is the name and version displayed in the SonarCloud UI.
910
#sonar.projectName=rxjs-collection

0 commit comments

Comments
 (0)