Spaces:
Sleeping
Sleeping
Download tests/api-tester/lib/TestFactory.js from AZILS/puter-deploy: direct link, hf CLI and curl.
- Browser
- Download file 868 Bytes
-
https://huggingface.co/spaces/AZILS/puter-deploy/resolve/main/tests/api-tester/lib/TestFactory.js
- Command line
-
hf download hf://spaces/AZILS/puter-deploy/tests/api-tester/lib/TestFactory.js
-
curl -L -o TestFactory.js https://huggingface.co/spaces/AZILS/puter-deploy/resolve/main/tests/api-tester/lib/TestFactory.js
868 Bytes
| module.exports = class TestFactory { | |
| static cartesian ( | |
| name, | |
| coverageModel, | |
| { each, init } | |
| ) { | |
| const do_ = async t => { | |
| const states = coverageModel.states; | |
| if ( init ) await init(t); | |
| for ( let i=0 ; i < states.length ; i++ ) { | |
| const state = states[i]; | |
| if ( t.context.options?.onlycase !== undefined ) { | |
| if ( i !== t.context.options.onlycase ) { | |
| continue; | |
| } | |
| } | |
| await t.case(`case ${i}`, async () => { | |
| console.log('state', state); | |
| await each(t, state, i); | |
| }) | |
| } | |
| }; | |
| return { | |
| name, | |
| do: do_, | |
| }; | |
| } | |
| } | |