File tree Expand file tree Collapse file tree 5 files changed +35
-25
lines changed Expand file tree Collapse file tree 5 files changed +35
-25
lines changed Original file line number Diff line number Diff line change @@ -411,7 +411,11 @@ jobs:
411
411
with :
412
412
path : ${{ env.CACHED_BUILD_PATHS }}
413
413
key : ${{ env.BUILD_CACHE_KEY }}
414
- - name : Run build tests
414
+ - name : Run browser build tests
415
415
run : |
416
416
cd packages/browser
417
417
yarn test:package
418
+ - name : Run utils build tests
419
+ run : |
420
+ cd packages/utils
421
+ yarn test:package
Original file line number Diff line number Diff line change 1
1
* .js.map
2
2
* .d.ts
3
3
* .js
4
+ ! test /package /build.js
4
5
! .eslintrc.js
Original file line number Diff line number Diff line change 45
45
"lint:prettier" : " prettier --check \" {src,test}/**/*.ts\" " ,
46
46
"pack" : " npm pack" ,
47
47
"test" : " jest" ,
48
- "test:watch" : " jest --watch"
48
+ "test:watch" : " jest --watch" ,
49
+ "test:package" : " node test/package/build.js"
49
50
},
50
51
"volta" : {
51
52
"extends" : " ../../package.json"
Load Diff This file was deleted.
Original file line number Diff line number Diff line change
1
+ const fs = require ( 'fs' ) ;
2
+ const path = require ( 'path' ) ;
3
+
4
+ const testStrings = [ `/// <reference types="node" />` ] ;
5
+
6
+ const paths = [ path . join ( './dist' ) , path . join ( './esm' ) ] ;
7
+
8
+ paths . forEach ( dir => {
9
+ if ( ! fs . existsSync ( dir ) ) {
10
+ // eslint-disable-next-line no-console
11
+ console . error ( `${ dir } doesn't exist please build first` ) ;
12
+ process . exit ( 1 ) ;
13
+ }
14
+ const files = fs . readdirSync ( dir ) ;
15
+ files . forEach ( file => {
16
+ if ( file . includes ( '.d.ts' ) ) {
17
+ testStrings . forEach ( testString => {
18
+ const filePath = path . join ( dir , file )
19
+ if ( fs . readFileSync ( filePath , 'utf8' ) . includes ( testString ) ) {
20
+ // eslint-disable-next-line no-console
21
+ console . error ( `${ filePath } contains types` ) ;
22
+ process . exit ( 1 ) ;
23
+ }
24
+ } ) ;
25
+ }
26
+ } ) ;
27
+ } ) ;
You can’t perform that action at this time.
0 commit comments