Skip to content
This repository has been archived by the owner on May 22, 2024. It is now read-only.

Commit

Permalink
chore: refactor testMany test util (#695)
Browse files Browse the repository at this point in the history
* chore: refactor testMany test util

* chore: add JS_ESBUILD_ZISI variation

* chore: fix test
  • Loading branch information
eduardoboucas committed Oct 4, 2021
1 parent 1efb897 commit 3ffe5c2
Show file tree
Hide file tree
Showing 3 changed files with 666 additions and 505 deletions.
19 changes: 0 additions & 19 deletions tests/helpers/test_bundlers.js

This file was deleted.

25 changes: 25 additions & 0 deletions tests/helpers/test_many.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
const makeTestMany = (test, matrix) => {
const testBundlers = (title, variationNames, assertions, testFn = test) => {
variationNames.forEach((name) => {
const variation = matrix[name]

if (name === undefined || variation === undefined) {
throw new Error(`Unknown variation in test: ${name}`)
}

const testTitle = `${title} [${name}]`

testFn(testTitle, assertions.bind(null, variation))
})
}

const testFns = ['failing', 'only', 'serial', 'skip']

testFns.forEach((fn) => {
testBundlers[fn] = (...args) => testBundlers(...args, test[fn])
})

return testBundlers
}

module.exports = { makeTestMany }

1 comment on commit 3ffe5c2

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⏱ Benchmark results

largeDepsEsbuild: 12.1s

largeDepsZisi: 1m 5.2s

Please sign in to comment.