repository-provider-test-support 2.2.38 → 2.3.1
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/package.json +4 -3
- package/src/entry-list-test.mjs +18 -7
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "repository-provider-test-support",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.3.1",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -27,17 +27,18 @@
|
|
|
27
27
|
"lint:docs": "documentation lint ./src/**/*.mjs"
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
|
+
"browser-stream-util": "^1.0.0",
|
|
30
31
|
"content-entry": "^6.0.0"
|
|
31
32
|
},
|
|
32
33
|
"devDependencies": {
|
|
33
34
|
"ava": "^5.2.0",
|
|
34
35
|
"c8": "^7.13.0",
|
|
35
36
|
"documentation": "^14.0.1",
|
|
36
|
-
"repository-provider": "^32.6.
|
|
37
|
+
"repository-provider": "^32.6.9",
|
|
37
38
|
"semantic-release": "^20.1.1"
|
|
38
39
|
},
|
|
39
40
|
"engines": {
|
|
40
|
-
"node": ">=16.19.
|
|
41
|
+
"node": ">=16.19.1"
|
|
41
42
|
},
|
|
42
43
|
"repository": {
|
|
43
44
|
"type": "git",
|
package/src/entry-list-test.mjs
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { streamToString } from "browser-stream-util";
|
|
2
|
+
|
|
1
3
|
export async function entryListTest(t, branch, pattern, entryFixtures) {
|
|
2
4
|
t.plan(
|
|
3
5
|
Object.values(entryFixtures).filter(e => e.isCollection).length +
|
|
@@ -27,14 +29,23 @@ export async function entryListTest(t, branch, pattern, entryFixtures) {
|
|
|
27
29
|
);
|
|
28
30
|
|
|
29
31
|
const stream = await entry.readStream;
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
32
|
+
|
|
33
|
+
if (stream instanceof ReadableStream) {
|
|
34
|
+
const string = await streamToString(stream);
|
|
35
|
+
t.true(
|
|
36
|
+
string.startsWith(ef.startsWith),
|
|
37
|
+
`startsWith '${entry.name}'`
|
|
38
|
+
);
|
|
39
|
+
} else {
|
|
40
|
+
const chunks = [];
|
|
41
|
+
for await (const chunk of stream) {
|
|
42
|
+
chunks.push(chunk);
|
|
43
|
+
}
|
|
44
|
+
t.true(
|
|
45
|
+
chunks.join().startsWith(ef.startsWith),
|
|
46
|
+
`startsWith '${entry.name}'`
|
|
47
|
+
);
|
|
33
48
|
}
|
|
34
|
-
t.true(
|
|
35
|
-
chunks.join().startsWith(ef.startsWith),
|
|
36
|
-
`startsWith '${entry.name}'`
|
|
37
|
-
);
|
|
38
49
|
}
|
|
39
50
|
if (ef.mode) {
|
|
40
51
|
t.is(entry.mode, ef.mode, `mode '${entry.name}'`);
|