File tree Expand file tree Collapse file tree 3 files changed +29
-1
lines changed Expand file tree Collapse file tree 3 files changed +29
-1
lines changed Original file line number Diff line number Diff line change 11# Changelog
22
3+ ## Unreleased
4+
5+ - [ utils] fix: Remove node types
6+
37## 5.0.7
48
59- [ utils] ref: Move ` htmlTreeAsString ` to ` @sentry/browser `
Original file line number Diff line number Diff line change @@ -14,7 +14,8 @@ interface SentryGlobal {
1414 *
1515 * @param request The module path to resolve
1616 */
17- export function dynamicRequire ( mod : NodeModule , request : string ) : any {
17+ export function dynamicRequire ( mod : any , request : string ) : any {
18+ // tslint:disable-next-line: no-unsafe-any
1819 return mod . require ( request ) ;
1920}
2021
Original file line number Diff line number Diff line change 1+ import * as fs from 'fs' ;
2+ import * as path from 'path' ;
3+
4+ const testStrings = [ `/// <reference types="node" />` ] ;
5+
6+ describe ( 'build' , ( ) => {
7+ test ( 'not contains types' , ( ) => {
8+ const paths = [ path . join ( './dist' ) , path . join ( './esm' ) ] ;
9+ paths . forEach ( dir => {
10+ if ( ! fs . existsSync ( dir ) ) {
11+ expect ( dir ) . toBe ( `${ dir } doesn't exist please build first` ) ;
12+ }
13+ const files = fs . readdirSync ( dir ) ;
14+ files . forEach ( file => {
15+ if ( file . includes ( '.d.ts' ) ) {
16+ testStrings . forEach ( testString => {
17+ expect ( fs . readFileSync ( path . join ( dir , file ) , 'utf8' ) ) . toEqual ( expect . not . stringContaining ( testString ) ) ;
18+ } ) ;
19+ }
20+ } ) ;
21+ } ) ;
22+ } ) ;
23+ } ) ;
You can’t perform that action at this time.
0 commit comments