Skip to content

Commit eefd71f

Browse files
authored
test(bazel): ensure shared chunks work properly in API golden testing (#2656)
This verifies that shared `.d.ts` chunks work properly in API golden testing. It's fine (and keeps the code simple) to just expect the shared definition to be repeated in the package entry-point goldens (it's still a single command to update)
1 parent feae4f9 commit eefd71f

File tree

5 files changed

+11
-0
lines changed

5 files changed

+11
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export const sharedChunk = true;
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import {fromTopLevel} from 'test-package';
22

3+
export {sharedChunk} from '.././shared_chunk.js';
4+
35
export declare const anotherVariable = fromTopLevel;
46

57
export declare function rawStringFn(input: string): string;
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
import * as babel from '@babel/core';
22

3+
export {sharedChunk} from '.././shared_chunk.js';
4+
35
export declare function acceptVersion(v: babel.types.ExistsTypeAnnotation): void;
46
export declare const nestedFile = true;

bazel/api-golden/test/goldens/test_package/testing/index.api.md

+3
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ export const anotherVariable = fromTopLevel;
1010
// @public (undocumented)
1111
export function rawStringFn(input: string): string;
1212

13+
// @public (undocumented)
14+
export const sharedChunk = true;
15+
1316
// (No @packageDocumentation comment for this package)
1417

1518
```

bazel/api-golden/test/goldens/test_package/testing/nested/index.api.md

+3
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ export function acceptVersion(v: babel_2.types.ExistsTypeAnnotation): void;
1212
// @public (undocumented)
1313
export const nestedFile = true;
1414

15+
// @public (undocumented)
16+
export const sharedChunk = true;
17+
1518
// (No @packageDocumentation comment for this package)
1619

1720
```

0 commit comments

Comments
 (0)