-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add ES3 and CommonJS to the default compiler options, add jasmine-node and multiple unit tests This part of the effort to create an official TypeScript compiler: Urigo/angular2-meteor#89 Urigo/angular2-meteor#90 Urigo/angular2-meteor#102
- Loading branch information
Showing
7 changed files
with
107 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,6 +31,6 @@ | |
"random-js": "^1.0.3" | ||
}, | ||
"devDependencies": { | ||
"mocha": "^2.2.5" | ||
"jasmine-node": "^1.14.5" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,5 @@ | ||
#!/usr/bin/env bash | ||
|
||
cd $(dirname $0) | ||
TEST_DIR=$(pwd) | ||
|
||
TYPESCRIPT_CACHE_DIR=${TEST_DIR}/.cache | ||
export TYPESCRIPT_CACHE_DIR | ||
|
||
node tests.js | ||
jasmine-node * --config "TYPESCRIPT_CACHE_DIR" ".cache" |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
var meteorTS = require("../index"); | ||
|
||
describe("meteor-typescript", function() { | ||
|
||
var testCodeLine = "export const foo = 'foo'"; | ||
|
||
it("should compile with defaults", function() { | ||
var result = meteorTS.compile(testCodeLine); | ||
expect(result.code.indexOf("exports.foo")).toEqual(0); | ||
}); | ||
|
||
it("should throw on wrong option", function() { | ||
var test = function() { | ||
meteorTS.compile(testCodeLine, { | ||
"wrong": true | ||
}); | ||
}; | ||
expect(test).toThrow(); | ||
}); | ||
|
||
it("should recognize preset options", function() { | ||
var result = meteorTS.compile(testCodeLine, { | ||
compilerOptions: { | ||
module: "system" | ||
} | ||
}); | ||
expect(result.code.indexOf("System.register")).toEqual(0); | ||
}); | ||
|
||
it("should add module with moduleName name when moduleName is set", | ||
function() { | ||
var result = meteorTS.compile(testCodeLine, { | ||
compilerOptions: { | ||
module: "system" | ||
}, | ||
moduleName: "fooModule" | ||
}); | ||
expect(result.code.indexOf("System.register(\"fooModule\"")) | ||
.toEqual(0); | ||
}); | ||
|
||
it("should throw on wrong compiler option", function() { | ||
var test = function() { | ||
meteorTS.compile(testCodeLine, { | ||
compilerOptions: { | ||
module: "wrong" | ||
} | ||
}); | ||
}; | ||
expect(test).toThrow(); | ||
}); | ||
|
||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters