MCPcopy Create free account
hub / github.com/codecombat/codecombat / isSuccessful

Method isSuccessful

app/views/editor/verifier/VerifierTest.js:228–245  ·  view source on GitHub ↗
(careAboutFrames)

Source from the content-addressed store, hash-verified

226 }
227
228 isSuccessful (careAboutFrames) {
229 if (careAboutFrames == null) { careAboutFrames = true }
230 if (this.solution == null) { return false }
231 if ((this.frames !== this.solution.frameCount) && !!careAboutFrames) { return false }
232 if (this.simulationFrameRate < 30) { return false }
233 if (this.goals && this.solution.goals) {
234 for (const k in this.goals) {
235 if (!this.solution.goals[k]) { continue }
236 if (this.solution.goals[k] !== this.goals[k].status) { return false }
237 }
238 } else if (this.goals) {
239 const allPassed = _.all(this.goals, goal => goal.status === 'success')
240 const someFailed = _.any(this.goals, goal => goal.status !== 'success')
241 if (this.solution.succeeds) { return allPassed }
242 if (!this.solution.succeeds) { return someFailed }
243 }
244 return true
245 }
246
247 onUserCodeProblem (e) {
248 console.warn('Found user code problem:', e)

Callers 5

onTestLevelsLoadedMethod · 0.95
scheduleCleanupMethod · 0.95
rerunFailedTestsMethod · 0.80
onVerifierTestUpdateMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected