({ sourceLevel, thangs, solutionCode, starterCode, supermodel })
| 1712 | } |
| 1713 | |
| 1714 | async function verifyLevel ({ sourceLevel, thangs, solutionCode, starterCode, supermodel }) { |
| 1715 | // console.log('Should verify', { sourceLevel, thangs, solutionCode, starterCode }) |
| 1716 | const solutions = constructSolutions({ solutionCode, starterCode }) |
| 1717 | const testContext = { running: 0, problems: 0, failed: 0, passedExceptFrames: 0, passed: 0, waiting: solutions.length, completed: 0, total: solutions.length } |
| 1718 | |
| 1719 | return new Promise((resolve) => { |
| 1720 | const onVerifierTestUpdate = createVerifierTestListener(testContext, () => { |
| 1721 | if (testContext.completed === solutions.length || testContext.aborted) { |
| 1722 | resolve(testContext.passed + testContext.passedExceptFrames === solutions.length) |
| 1723 | } |
| 1724 | }) |
| 1725 | |
| 1726 | solutions.map(solution => { |
| 1727 | const childSupermodel = new SuperModel() |
| 1728 | childSupermodel.models = _.clone(supermodel.models) |
| 1729 | childSupermodel.collections = _.clone(supermodel.collections) |
| 1730 | return new VerifierTest(sourceLevel.get('slug'), onVerifierTestUpdate, childSupermodel, 'javascript', { devMode: false, solution, thangsOverride: thangs }) |
| 1731 | }) |
| 1732 | }) |
| 1733 | } |
| 1734 | |
| 1735 | function constructSolutions ({ solutionCode, starterCode }) { |
| 1736 | const solutions = [] |
no test coverage detected