(options, levelID)
| 45 | } |
| 46 | |
| 47 | constructor (options, levelID) { |
| 48 | super(options) |
| 49 | this.update = this.update.bind(this) |
| 50 | this.levelID = levelID |
| 51 | // TODO: sort tests by unexpected result first |
| 52 | this.passed = 0 |
| 53 | this.failed = 0 |
| 54 | this.problem = 0 |
| 55 | this.testCount = 0 |
| 56 | |
| 57 | if (utils.getQueryVariable('dev')) { |
| 58 | this.supermodel.shouldSaveBackups = model => // Make sure to load possibly changed things from localStorage. |
| 59 | ['Level', 'LevelComponent', 'LevelSystem', 'ThangType'].includes(model.constructor.className) |
| 60 | } |
| 61 | |
| 62 | this.cores = window.navigator.hardwareConcurrency || 4 |
| 63 | this.careAboutFrames = utils.getQueryVariable('frames', true) |
| 64 | |
| 65 | this.testLanguages = (utils.getQueryVariable('languages') || 'python,javascript,java,cpp,lua,coffeescript').split(',') |
| 66 | this.codeLanguages = this.testLanguages.map((c) => ({ id: c, checked: true })) |
| 67 | |
| 68 | if (this.levelID) { |
| 69 | this.levelIDs = [this.levelID] |
| 70 | this.cores = 1 |
| 71 | this.startTestingLevels() |
| 72 | } else { |
| 73 | this.campaigns = new Campaigns() |
| 74 | this.supermodel.trackRequest(this.campaigns.fetch({ data: { project: 'slug,type,levels' } })) |
| 75 | this.campaigns.comparator = m => ['intro', 'course-2', 'course-3', 'course-4', 'course-5', 'course-6', 'course-8', |
| 76 | 'dungeon', 'forest', 'desert', 'mountain', 'glacier', 'volcano', 'campaign-game-dev-1', 'campaign-game-dev-2', 'campaign-game-dev-3', 'hoc-2018'].indexOf(m.get('slug')) |
| 77 | } |
| 78 | } |
| 79 | |
| 80 | onLoaded () { |
| 81 | super.onLoaded() |
nothing calls this directly
no test coverage detected