Skip to content

Commit

Permalink
Simplify scenario sets in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
atkinchris committed Apr 30, 2021
1 parent b9299ac commit 9b70458
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
2 changes: 1 addition & 1 deletion tests/presets.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ describe('presets', () => {
})

describe('next-only', () => {
scenarioRunner(scenarios.filterScenarios('next.js'), 'next-only')
scenarioRunner(scenarios.next, 'next-only')
})
})
9 changes: 3 additions & 6 deletions tests/scenarios.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ const buildNextJsScript = (method, payload) => `
require('next/dist/build/output/log').${method}(${payload})
`

const scenarios = [
const nextScenarios = [
// Next.js logger - basic messages
[
'next.js - wait - message',
Expand Down Expand Up @@ -67,8 +67,5 @@ const scenarios = [
],
]

const filterScenarios = (...filters) =>
scenarios.filter(scenario => filters.some(filter => scenario[0].startsWith(filter)))

module.exports = scenarios
module.exports.filterScenarios = filterScenarios
module.exports = [...nextScenarios]
module.exports.next = nextScenarios

0 comments on commit 9b70458

Please sign in to comment.