Conversation
| "noImplicitAny" : true, | ||
| "noImplicitThis" : true, | ||
| "alwaysStrict" : true, | ||
| "strictNullChecks": true, |
There was a problem hiding this comment.
Strict flags (and others) are tsc flags and should not be tested by our compiler.
| "noImplicitThis" : true, | ||
| "alwaysStrict" : true, | ||
| "strictNullChecks": true, | ||
| "luaTarget": "JIT" |
There was a problem hiding this comment.
luatarget ist not a compilerOption and needs to be declared in the root of the config.json.
| // Delete outDir folder | ||
| removeSync('test/integration/project/outDir'); | ||
| } | ||
|
|
There was a problem hiding this comment.
Not sure that checking if a file exist is the best way to test the compiler.
There was a problem hiding this comment.
These tests are about outDir and rootDir and I think those are appropriately tested with that. But I'd be happy to implement something else if you tell me what you think it should be instead.
There was a problem hiding this comment.
Right makes sense. Might want to rename the test.
I was thinking about checking if paths are resolved correctly directly, but this is hard to test since all the resolve stuff is packed into parseCommandLine() and compile() which makes it hard to test directly. So checking if a file exists is probably the best way right now. I might revisit this when I rewrite the CLI interface.
| }); | ||
|
|
||
| // Delete outDir folder | ||
| removeSync('test/integration/project/outDir'); |
There was a problem hiding this comment.
please use a function with @teardown for cleanup https://github.com/alsatian-test/alsatian/wiki/pre-and-post-test.
| @@ -0,0 +1,36 @@ | |||
| import { Expect, Test, TestCase } from "alsatian"; | |||
| import { execSync } from "child_process" | |||
| import { existsSync, removeSync, unlink } from "fs-extra" | |||
There was a problem hiding this comment.
Why do you need fs-extra all those functions exist in default fs.
There was a problem hiding this comment.
fs-extra can delete non empty directories.
There was a problem hiding this comment.
RIP thought default node could do that by now.
| const tsconfigPath = resolve('test/integration/project', tsconfig); | ||
|
|
||
| // Compile project | ||
| execSync(`node ${compilerPath} -p ${tsconfigPath}`); |
There was a problem hiding this comment.
Don't use exec to test. Errors won't be reported correctly also coverage reports probably won't work either.
There was a problem hiding this comment.
What should I use instead?
There was a problem hiding this comment.
function executeCommandLine(args: ReadonlyArray)
There was a problem hiding this comment.
I can't figure this out, I tried passing a callback but it never gets called.
Please also enable AppVeyor for Windows testing.