@durable-streams/server-conformance-tests 0.1.3 → 0.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.cjs +11 -10
- package/dist/cli.js +11 -10
- package/package.json +3 -2
- package/src/cli.ts +23 -38
package/dist/cli.cjs
CHANGED
|
@@ -86,14 +86,19 @@ function getTestRunnerPath() {
|
|
|
86
86
|
if ((0, node_fs.existsSync)(runnerInDist)) return runnerInDist;
|
|
87
87
|
return runnerInSrc;
|
|
88
88
|
}
|
|
89
|
+
function findVitestBinary() {
|
|
90
|
+
const possiblePaths = [
|
|
91
|
+
(0, node_path.join)(__dirname$1, `..`, `node_modules`, `.bin`, `vitest`),
|
|
92
|
+
(0, node_path.join)(__dirname$1, `..`, `..`, `..`, `..`, `.bin`, `vitest`),
|
|
93
|
+
(0, node_path.join)(__dirname$1, `..`, `..`, `..`, `node_modules`, `.bin`, `vitest`)
|
|
94
|
+
];
|
|
95
|
+
for (const vitestPath of possiblePaths) if ((0, node_fs.existsSync)(vitestPath)) return vitestPath;
|
|
96
|
+
return `vitest`;
|
|
97
|
+
}
|
|
89
98
|
function runTests(baseUrl) {
|
|
90
99
|
return new Promise((resolvePromise) => {
|
|
91
100
|
const runnerPath = getTestRunnerPath();
|
|
92
|
-
const
|
|
93
|
-
const vitestBinAlt = (0, node_path.join)(__dirname$1, `..`, `..`, `..`, `node_modules`, `.bin`, `vitest`);
|
|
94
|
-
let vitestPath = `vitest`;
|
|
95
|
-
if ((0, node_fs.existsSync)(vitestBin)) vitestPath = vitestBin;
|
|
96
|
-
else if ((0, node_fs.existsSync)(vitestBinAlt)) vitestPath = vitestBinAlt;
|
|
101
|
+
const vitestPath = findVitestBinary();
|
|
97
102
|
const args = [
|
|
98
103
|
`run`,
|
|
99
104
|
runnerPath,
|
|
@@ -130,11 +135,7 @@ async function runWatch(baseUrl, watchPaths) {
|
|
|
130
135
|
const DEBOUNCE_MS = 300;
|
|
131
136
|
const spawnTests = () => {
|
|
132
137
|
const runnerPath = getTestRunnerPath();
|
|
133
|
-
const
|
|
134
|
-
const vitestBinAlt = (0, node_path.join)(__dirname$1, `..`, `..`, `..`, `node_modules`, `.bin`, `vitest`);
|
|
135
|
-
let vitestPath = `vitest`;
|
|
136
|
-
if ((0, node_fs.existsSync)(vitestBin)) vitestPath = vitestBin;
|
|
137
|
-
else if ((0, node_fs.existsSync)(vitestBinAlt)) vitestPath = vitestBinAlt;
|
|
138
|
+
const vitestPath = findVitestBinary();
|
|
138
139
|
const args = [
|
|
139
140
|
`run`,
|
|
140
141
|
runnerPath,
|
package/dist/cli.js
CHANGED
|
@@ -84,14 +84,19 @@ function getTestRunnerPath() {
|
|
|
84
84
|
if (existsSync(runnerInDist)) return runnerInDist;
|
|
85
85
|
return runnerInSrc;
|
|
86
86
|
}
|
|
87
|
+
function findVitestBinary() {
|
|
88
|
+
const possiblePaths = [
|
|
89
|
+
join(__dirname, `..`, `node_modules`, `.bin`, `vitest`),
|
|
90
|
+
join(__dirname, `..`, `..`, `..`, `..`, `.bin`, `vitest`),
|
|
91
|
+
join(__dirname, `..`, `..`, `..`, `node_modules`, `.bin`, `vitest`)
|
|
92
|
+
];
|
|
93
|
+
for (const vitestPath of possiblePaths) if (existsSync(vitestPath)) return vitestPath;
|
|
94
|
+
return `vitest`;
|
|
95
|
+
}
|
|
87
96
|
function runTests(baseUrl) {
|
|
88
97
|
return new Promise((resolvePromise) => {
|
|
89
98
|
const runnerPath = getTestRunnerPath();
|
|
90
|
-
const
|
|
91
|
-
const vitestBinAlt = join(__dirname, `..`, `..`, `..`, `node_modules`, `.bin`, `vitest`);
|
|
92
|
-
let vitestPath = `vitest`;
|
|
93
|
-
if (existsSync(vitestBin)) vitestPath = vitestBin;
|
|
94
|
-
else if (existsSync(vitestBinAlt)) vitestPath = vitestBinAlt;
|
|
99
|
+
const vitestPath = findVitestBinary();
|
|
95
100
|
const args = [
|
|
96
101
|
`run`,
|
|
97
102
|
runnerPath,
|
|
@@ -128,11 +133,7 @@ async function runWatch(baseUrl, watchPaths) {
|
|
|
128
133
|
const DEBOUNCE_MS = 300;
|
|
129
134
|
const spawnTests = () => {
|
|
130
135
|
const runnerPath = getTestRunnerPath();
|
|
131
|
-
const
|
|
132
|
-
const vitestBinAlt = join(__dirname, `..`, `..`, `..`, `node_modules`, `.bin`, `vitest`);
|
|
133
|
-
let vitestPath = `vitest`;
|
|
134
|
-
if (existsSync(vitestBin)) vitestPath = vitestBin;
|
|
135
|
-
else if (existsSync(vitestBinAlt)) vitestPath = vitestBinAlt;
|
|
136
|
+
const vitestPath = findVitestBinary();
|
|
136
137
|
const args = [
|
|
137
138
|
`run`,
|
|
138
139
|
runnerPath,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@durable-streams/server-conformance-tests",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.4",
|
|
4
4
|
"description": "Conformance test suite for Durable Streams server implementations",
|
|
5
5
|
"author": "Durable Stream contributors",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -23,6 +23,7 @@
|
|
|
23
23
|
"module": "./dist/index.js",
|
|
24
24
|
"types": "./dist/index.d.ts",
|
|
25
25
|
"bin": {
|
|
26
|
+
"server-conformance-tests": "./dist/cli.js",
|
|
26
27
|
"durable-streams-server-conformance": "./dist/cli.js",
|
|
27
28
|
"durable-streams-server-conformance-dev": "./bin/conformance-dev.mjs"
|
|
28
29
|
},
|
|
@@ -47,7 +48,7 @@
|
|
|
47
48
|
],
|
|
48
49
|
"dependencies": {
|
|
49
50
|
"fast-check": "^4.4.0",
|
|
50
|
-
"vitest": "^
|
|
51
|
+
"vitest": "^4.0.0",
|
|
51
52
|
"@durable-streams/client": "0.1.2"
|
|
52
53
|
},
|
|
53
54
|
"devDependencies": {
|
package/src/cli.ts
CHANGED
|
@@ -131,28 +131,31 @@ function getTestRunnerPath(): string {
|
|
|
131
131
|
return runnerInSrc
|
|
132
132
|
}
|
|
133
133
|
|
|
134
|
+
// Find vitest binary in various possible locations
|
|
135
|
+
function findVitestBinary(): string {
|
|
136
|
+
const possiblePaths = [
|
|
137
|
+
// Package's own node_modules (bundled dependency)
|
|
138
|
+
join(__dirname, `..`, `node_modules`, `.bin`, `vitest`),
|
|
139
|
+
// Hoisted location for scoped packages (@scope/package-name/dist -> node_modules/.bin)
|
|
140
|
+
join(__dirname, `..`, `..`, `..`, `..`, `.bin`, `vitest`),
|
|
141
|
+
// Monorepo root node_modules (for development)
|
|
142
|
+
join(__dirname, `..`, `..`, `..`, `node_modules`, `.bin`, `vitest`),
|
|
143
|
+
]
|
|
144
|
+
|
|
145
|
+
for (const vitestPath of possiblePaths) {
|
|
146
|
+
if (existsSync(vitestPath)) {
|
|
147
|
+
return vitestPath
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
// Fallback to vitest in PATH
|
|
152
|
+
return `vitest`
|
|
153
|
+
}
|
|
154
|
+
|
|
134
155
|
function runTests(baseUrl: string): Promise<number> {
|
|
135
156
|
return new Promise((resolvePromise) => {
|
|
136
157
|
const runnerPath = getTestRunnerPath()
|
|
137
|
-
|
|
138
|
-
// Find vitest binary
|
|
139
|
-
const vitestBin = join(__dirname, `..`, `node_modules`, `.bin`, `vitest`)
|
|
140
|
-
const vitestBinAlt = join(
|
|
141
|
-
__dirname,
|
|
142
|
-
`..`,
|
|
143
|
-
`..`,
|
|
144
|
-
`..`,
|
|
145
|
-
`node_modules`,
|
|
146
|
-
`.bin`,
|
|
147
|
-
`vitest`
|
|
148
|
-
)
|
|
149
|
-
|
|
150
|
-
let vitestPath = `vitest`
|
|
151
|
-
if (existsSync(vitestBin)) {
|
|
152
|
-
vitestPath = vitestBin
|
|
153
|
-
} else if (existsSync(vitestBinAlt)) {
|
|
154
|
-
vitestPath = vitestBinAlt
|
|
155
|
-
}
|
|
158
|
+
const vitestPath = findVitestBinary()
|
|
156
159
|
|
|
157
160
|
const args = [
|
|
158
161
|
`run`,
|
|
@@ -199,25 +202,7 @@ async function runWatch(
|
|
|
199
202
|
|
|
200
203
|
const spawnTests = (): ChildProcess => {
|
|
201
204
|
const runnerPath = getTestRunnerPath()
|
|
202
|
-
|
|
203
|
-
// Find vitest binary
|
|
204
|
-
const vitestBin = join(__dirname, `..`, `node_modules`, `.bin`, `vitest`)
|
|
205
|
-
const vitestBinAlt = join(
|
|
206
|
-
__dirname,
|
|
207
|
-
`..`,
|
|
208
|
-
`..`,
|
|
209
|
-
`..`,
|
|
210
|
-
`node_modules`,
|
|
211
|
-
`.bin`,
|
|
212
|
-
`vitest`
|
|
213
|
-
)
|
|
214
|
-
|
|
215
|
-
let vitestPath = `vitest`
|
|
216
|
-
if (existsSync(vitestBin)) {
|
|
217
|
-
vitestPath = vitestBin
|
|
218
|
-
} else if (existsSync(vitestBinAlt)) {
|
|
219
|
-
vitestPath = vitestBinAlt
|
|
220
|
-
}
|
|
205
|
+
const vitestPath = findVitestBinary()
|
|
221
206
|
|
|
222
207
|
const args = [
|
|
223
208
|
`run`,
|