MCPcopy Index your code
hub / github.com/codecombat/codecombat / addTestCases

Method addTestCases

app/views/artisans/BlockTestingView.js:146–171  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

144 }
145
146 addTestCases () {
147 this.render()
148 const testCasesContainer = this.$el.find('#test-cases-container')
149 for (let i = this.testSkip; i < testCases.length && (this.focusTest || (i - this.testSkip < this.testLimit)); ++i) {
150 const testCase = testCases[i]
151 if (this.focusTest) {
152 if (this.focusTest === testCase.name) {
153 testCase.focused = true
154 } else {
155 continue
156 }
157 }
158 if (this.focusLanguage && this.focusLanguage !== testCase.codeLanguage) {
159 continue
160 }
161
162 const testCaseHtml = testTemplate({ testCaseIndex: i, testCase })
163 let testContainer = $(testCaseHtml)
164 testContainer.appendTo(testCasesContainer)
165 testContainer = testCasesContainer.find('.test-case:last-child')
166 testCase.code = testCase.code.trim()
167 testCase.key = `${testCase.name}_${testCase.codeLanguage}_${hashString(testCase.code)}`
168 const { inputAce, outputAce } = this.addAce({ testCase, testContainer })
169 _.defer(() => this.addBlockly({ testCase, testContainer, inputAce, outputAce }))
170 }
171 }
172
173 addAce ({ testCase, testContainer }) {
174 const aces = { input: null, output: null }

Callers 1

onAllLevelsLoadedMethod · 0.95

Calls 4

addAceMethod · 0.95
addBlocklyMethod · 0.95
hashStringFunction · 0.70
renderMethod · 0.45

Tested by

no test coverage detected