Skip to content

Commit

Permalink
test: should detect unsafe-import when detect obfuscated atob value
Browse files Browse the repository at this point in the history
  • Loading branch information
jean-michelet committed Feb 1, 2024
1 parent 94056a5 commit 2b1658a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions test/probes/isRequire.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -367,6 +367,11 @@ test("(require CallExpression): it should detect obfuscated atob value", () => {
const sastAnalysis = getSastAnalysis(str, isRequire)
.execute(ast.body);

assert.strictEqual(sastAnalysis.warnings().length, 1);
const warning = sastAnalysis.getWarning("unsafe-import");
assert.strictEqual(warning.kind, "unsafe-import");

const dependencies = sastAnalysis.dependencies();
assert.strictEqual(dependencies.size, 1);
assert.ok(dependencies.has("os"));
});

0 comments on commit 2b1658a

Please sign in to comment.