Skip to content

Commit d6e83fe

Browse files
committed
test: types
1 parent 0c63edd commit d6e83fe

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
/* eslint-disable */
2+
import { expectType } from 'tsd';
3+
import { type BundleSourceResult } from '../src';
4+
5+
expectType<BundleSourceResult<'endoZipBase64'>>({
6+
moduleFormat: 'endoZipBase64',
7+
endoZipBase64: '',
8+
endoZipBase64Sha512: '',
9+
});
10+
11+
expectType<BundleSourceResult<'endoZipBase64'>>({
12+
moduleFormat: 'endoZipBase64',
13+
endoZipBase64: '',
14+
endoZipBase64Sha512: '',
15+
});
16+
17+
expectType<BundleSourceResult<'endoZipBase64'>>({
18+
moduleFormat: 'endoZipBase64',
19+
endoZipBase64: '',
20+
// @ts-expect-error must be string
21+
endoZipBase64Sha512: undefined,
22+
});
23+
24+
// a 'test' bundle is importable but not a BundleSource result
25+
// @ts-expect-error Type '"test"' does not satisfy the constraint 'ModuleFormat'.
26+
type TestBundle = BundleSourceResult<'test'>;

0 commit comments

Comments
 (0)