🌐 AI搜索 & 代理 主页
Skip to content

Commit fcb111c

Browse files
committed
Tests: Clear the tmp-bundlers directory before running bundlers
1 parent d2bea64 commit fcb111c

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
"authors:check": "node -e \"require('./build/release/authors.js').checkAuthors()\"",
3737
"authors:update": "node -e \"require('./build/release/authors.js').updateAuthors()\"",
3838
"babel:tests": "babel test/data/core/jquery-iterability-transpiled-es6.js --out-file test/data/core/jquery-iterability-transpiled.js",
39-
"bundlers:tests": "rollup -c test/bundler_smoke_tests/rollup-pure-esm.config.js && rollup -c test/bundler_smoke_tests/rollup-commonjs.config.js && webpack -c test/bundler_smoke_tests/webpack.config.cjs",
39+
"bundlers:tests": "node -e \"require('./test/bundler_smoke_tests/utils.cjs').cleanTmpBundlersDir()\" && rollup -c test/bundler_smoke_tests/rollup-pure-esm.config.js && rollup -c test/bundler_smoke_tests/rollup-commonjs.config.js && webpack -c test/bundler_smoke_tests/webpack.config.cjs",
4040
"build": "node ./build/command.js",
4141
"build:all": "node -e \"require('./build/tasks/build.js').buildDefaultFiles()\"",
4242
"build:main": "node -e \"require('./build/tasks/build.js').build()\"",

test/bundler_smoke_tests/utils.cjs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
"use strict";
2+
3+
const fs = require( "node:fs/promises" );
4+
const path = require( "node:path" );
5+
const { fileURLToPath } = require( "node:url" );
6+
7+
const TEST_DIR = path.resolve( __dirname, ".." );
8+
const TMP_BUNDLERS_DIR = path.resolve( TEST_DIR, "data/core/tmp-bundlers" );
9+
10+
async function cleanTmpBundlersDir() {
11+
await fs.rm( TMP_BUNDLERS_DIR, {
12+
force: true,
13+
recursive: true
14+
} );
15+
}
16+
17+
module.exports = { cleanTmpBundlersDir };

0 commit comments

Comments
 (0)