repository-provider-test-support 2.2.37 → 2.3.0

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "repository-provider-test-support",
3
- "version": "2.2.37",
3
+ "version": "2.3.0",
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.7",
37
+ "repository-provider": "^32.6.9",
37
38
  "semantic-release": "^20.1.1"
38
39
  },
39
40
  "engines": {
40
- "node": ">=16.19.0"
41
+ "node": ">=16.19.1"
41
42
  },
42
43
  "repository": {
43
44
  "type": "git",
@@ -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
- const chunks = [];
31
- for await (const chunk of stream) {
32
- chunks.push(chunk);
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}'`);
@@ -1,8 +1,8 @@
1
1
  export async function providerTest(t, provider) {
2
2
  t.is(provider.provider, provider, "be our own provider");
3
3
  t.truthy(provider.name, "has a name");
4
- t.truthy(provider.fullName, "has a fullName");
5
- t.truthy(provider.url, "has a url");
4
+ t.truthy(provider.fullName, `${provider.name} has a fullName`);
5
+ t.truthy(provider.url, `${provider.name} has a url`);
6
6
 
7
7
  /*
8
8
  const repositoryGroup = await provider.repositoryGroup();