summaryrefslogtreecommitdiff
path: root/test/parallel/test-policy-parse-integrity.js
diff options
context:
space:
mode:
authorBradley Farias <bradley.meck@gmail.com>2020-07-16 16:00:21 -0500
committerBradley Farias <bradley.meck@gmail.com>2020-08-05 13:48:59 -0500
commitb04f2b661802adf5fd2c7731cd2d5e0f5cfe16d1 (patch)
treecfc04ce75b54ff36d75e58c1d6c2f6412d3ed042 /test/parallel/test-policy-parse-integrity.js
parente0d181cf2b690c4f2a4cd797a61d9b69997f4c75 (diff)
downloadnode-new-b04f2b661802adf5fd2c7731cd2d5e0f5cfe16d1.tar.gz
policy: increase tests via permutation matrix
PR-URL: https://github.com/nodejs/node/pull/34404 Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'test/parallel/test-policy-parse-integrity.js')
-rw-r--r--test/parallel/test-policy-parse-integrity.js14
1 files changed, 9 insertions, 5 deletions
diff --git a/test/parallel/test-policy-parse-integrity.js b/test/parallel/test-policy-parse-integrity.js
index 6fa9541639..2443d9691c 100644
--- a/test/parallel/test-policy-parse-integrity.js
+++ b/test/parallel/test-policy-parse-integrity.js
@@ -19,24 +19,28 @@ function hash(algo, body) {
return h.digest('base64');
}
-const policyFilepath = path.join(tmpdir.path, 'policy');
+const tmpdirPath = path.join(tmpdir.path, 'test-policy-parse-integrity');
+fs.rmdirSync(tmpdirPath, { maxRetries: 3, recursive: true });
+fs.mkdirSync(tmpdirPath, { recursive: true });
-const parentFilepath = path.join(tmpdir.path, 'parent.js');
+const policyFilepath = path.join(tmpdirPath, 'policy');
+
+const parentFilepath = path.join(tmpdirPath, 'parent.js');
const parentBody = "require('./dep.js')";
-const depFilepath = path.join(tmpdir.path, 'dep.js');
+const depFilepath = path.join(tmpdirPath, 'dep.js');
const depURL = pathToFileURL(depFilepath);
const depBody = '';
fs.writeFileSync(parentFilepath, parentBody);
fs.writeFileSync(depFilepath, depBody);
-const tmpdirURL = pathToFileURL(tmpdir.path);
+const tmpdirURL = pathToFileURL(tmpdirPath);
if (!tmpdirURL.pathname.endsWith('/')) {
tmpdirURL.pathname += '/';
}
-const packageFilepath = path.join(tmpdir.path, 'package.json');
+const packageFilepath = path.join(tmpdirPath, 'package.json');
const packageURL = pathToFileURL(packageFilepath);
const packageBody = '{"main": "dep.js"}';