()
| 256 | |
| 257 | @memoize |
| 258 | public getMainLuaFileResult(): ExecutableTranspiledFile { |
| 259 | const { transpiledFiles } = this.getLuaResult(); |
| 260 | const mainFileName = normalizeSlashes(this.mainFileName); |
| 261 | const mainFile = this.options.luaBundle |
| 262 | ? transpiledFiles[0] |
| 263 | : transpiledFiles.find(({ sourceFiles }) => sourceFiles.some(f => f.fileName === mainFileName)); |
| 264 | |
| 265 | if (mainFile === undefined) { |
| 266 | throw new Error( |
| 267 | `No source file could be found matching main file: ${mainFileName}.\nSource files in test:\n${transpiledFiles |
| 268 | .flatMap(f => f.sourceFiles.map(sf => sf.fileName)) |
| 269 | .join("\n")}` |
| 270 | ); |
| 271 | } |
| 272 | |
| 273 | expect(mainFile).toMatchObject({ lua: expect.any(String), luaSourceMap: expect.any(String) }); |
| 274 | return mainFile as ExecutableTranspiledFile; |
| 275 | } |
| 276 | |
| 277 | @memoize |
| 278 | public getMainLuaCodeChunk(): string { |
nothing calls this directly
no test coverage detected