File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 7171 "@types/convert-source-map" : " ^1.5.1" ,
7272 "@types/debug" : " ^4.1.0" ,
7373 "@types/resolve" : " ^1.3.2" ,
74- "@types/semver" : " ^5.4.0"
74+ "@types/semver" : " ^5.4.0" ,
75+ "rimraf" : " ^3.0.0"
7576 },
7677 "conditions" : {
7778 "BABEL_8_BREAKING" : [
Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ import os from "os";
33import path from "path" ;
44import { fileURLToPath } from "url" ;
55import babel from "../lib/index.js" ;
6+ import rimraf from "rimraf" ;
67
78import _getTargets from "@babel/helper-compilation-targets" ;
89const getTargets = _getTargets . default ;
@@ -68,14 +69,24 @@ function escapeRegExp(string) {
6869 return string . replace ( / [ | \\ { } ( ) [ \] ^ $ + * ? . ] / g, "\\$&" ) ;
6970}
7071
72+ const tempDirs = [ ] ;
73+
7174async function getTemp ( name ) {
72- const cwd = await pfs . mkdtemp ( os . tmpdir ( ) + path . sep + name ) ;
75+ const tempDir = os . tmpdir ( ) + path . sep + name ;
76+ tempDirs . push ( tempDir ) ;
77+ const cwd = await pfs . mkdtemp ( tempDir ) ;
7378 const tmp = name => path . join ( cwd , name ) ;
7479 const config = name =>
7580 pfs . copyFile ( fixture ( "config-files-templates" , name ) , tmp ( name ) ) ;
7681 return { cwd, tmp, config } ;
7782}
7883
84+ afterAll ( ( ) => {
85+ for ( const dir of tempDirs ) {
86+ rimraf . sync ( dir ) ;
87+ }
88+ } ) ;
89+
7990describe ( "buildConfigChain" , function ( ) {
8091 describe ( "test" , ( ) => {
8192 describe ( "single" , ( ) => {
Original file line number Diff line number Diff line change @@ -343,6 +343,7 @@ __metadata:
343343 debug: ^4.1.0
344344 gensync: ^1.0.0-beta.2
345345 json5: ^2.2.1
346+ rimraf: ^3.0.0
346347 semver: "condition:BABEL_8_BREAKING ? ^7.3.4 : ^6.3.0"
347348 languageName: unknown
348349 linkType: soft
You can’t perform that action at this time.
0 commit comments