Skip to content

Commit

Permalink
Fall back to 45sec timeouts and move file error test to end of suite
Browse files Browse the repository at this point in the history
  • Loading branch information
bkimminich committed Sep 26, 2021
1 parent a035ce6 commit 9f5d113
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
},
"scripts": {
"coverage": "nyc report --reporter=lcov",
"e2e": "nyc --reporter=text mocha test/e2e --slow=25000 --timeout=180000",
"e2e": "nyc --reporter=text mocha test/e2e --slow=25000 --timeout=45000",
"lint": "standard",
"lint:fix": "standard --fix",
"test": "nyc --reporter=html --reporter=text mocha test/unit"
Expand Down
16 changes: 8 additions & 8 deletions test/e2e/juiceShopCtfCli-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const configFile = 'config.yml'
const util = require('util')
const execFile = util.promisify(require('child_process').execFile)

const TIMEOUT = 180000
const TIMEOUT = 45000
const juiceShopCtfCli = [path.join(__dirname, '../../bin/juice-shop-ctf.js')]

function cleanup () {
Expand Down Expand Up @@ -103,13 +103,6 @@ describe('juice-shop-ctf', () => {
.eventually.match(/CTF framework to generate data for\? RootTheBox/i)
})

it('should fail when output file cannot be written', function () {
this.timeout(TIMEOUT)
fs.openSync(outputFile, 'w', 0)
return expect(run(juiceShopCtfCli, [ENTER, ENTER, ENTER, ENTER, ENTER, ENTER], 2000)).to
.eventually.match(/Failed to write output to file!/i)
})

it('should accept a config file', function () {
fs.writeFileSync(configFile, `
juiceShopUrl: https://juice-shop.herokuapp.com
Expand Down Expand Up @@ -206,4 +199,11 @@ insertHintSnippets: paid`)
.then(() => fs.existsSync(desiredRtbOutputFile))).to
.eventually.equal(true)
})

it('should fail when output file cannot be written', function () {
this.timeout(TIMEOUT)
fs.openSync(outputFile, 'w', 0)
return expect(run(juiceShopCtfCli, [ENTER, ENTER, ENTER, ENTER, ENTER, ENTER], 2000)).to
.eventually.match(/Failed to write output to file!/i)
})
})

0 comments on commit 9f5d113

Please sign in to comment.