Skip to content

Commit

Permalink
fix: ensure copy is cleared (#388)
Browse files Browse the repository at this point in the history
  • Loading branch information
cfabianski authored May 3, 2024
1 parent f321afc commit 96ffff5
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 26 deletions.
1 change: 1 addition & 0 deletions scripts/invoke.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ DEBUG=${DEBUG=false}
filename=$(basename $test_location)
tmp_location=/tmp/bearer-scan/$filename
mkdir -p /tmp/bearer-scan
rm -rf $tmp_location
cp -R $test_location $tmp_location
if [ -n "$BEARER_BIN" ]; then
$BEARER_BIN scan $tmp_location \
Expand Down
46 changes: 20 additions & 26 deletions tests/javascript/third_parties/marked/test.js
Original file line number Diff line number Diff line change
@@ -1,39 +1,33 @@
const {
createNewInvoker,
getEnvironment,
} = require("../../../helper.js")
const { createNewInvoker, getEnvironment } = require("../../../helper.js")
const { ruleId, ruleFile, testBase } = getEnvironment(__dirname)

describe(ruleId, () => {
const invoke = createNewInvoker(ruleId, ruleFile, testBase)

// FIXME: investigate - CI failure!
// passes individually, fails when run together with
// dom_purify test case
// test("insecure", () => {
// const testCase = "insecure"
test("insecure", () => {
const testCase = "insecure"

// const results = invoke(testCase)
const results = invoke(testCase)

// expect(results.Missing).toEqual([])
// expect(results.Extra).toEqual([])
// })
expect(results.Missing).toEqual([])
expect(results.Extra).toEqual([])
})

test("not_used", () => {
const testCase = "not_used"
test("not_used", () => {
const testCase = "not_used"

const results = invoke(testCase)
const results = invoke(testCase)

expect(results.Missing).toEqual([])
expect(results.Extra).toEqual([])
})
expect(results.Missing).toEqual([])
expect(results.Extra).toEqual([])
})

test("secure", () => {
const testCase = "secure"
test("secure", () => {
const testCase = "secure"

const results = invoke(testCase)
const results = invoke(testCase)

expect(results.Missing).toEqual([])
expect(results.Extra).toEqual([])
})
})
expect(results.Missing).toEqual([])
expect(results.Extra).toEqual([])
})
})

0 comments on commit 96ffff5

Please sign in to comment.