Skip to content

Commit 23d0ea3

Browse files
committed
Add Alsatian tests and Travis CI
1 parent 461863e commit 23d0ea3

File tree

16 files changed

+358
-186
lines changed

16 files changed

+358
-186
lines changed

.travis.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
language: node_js
2+
3+
node_js:
4+
- 'stable'
5+
6+
install:
7+
- npm install
8+
9+
script:
10+
- tsc -p ./test
11+
- node ./test/runner.js

package-lock.json

Lines changed: 283 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
{
22
"dependencies": {
33
"alsatian": "^2.1.0",
4-
"ts-node": "^4.1.0",
54
"typescript": "^2.7.1"
65
}
76
}

test/integration/tsconfig.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"compilerOptions": {
3+
"noImplicitAny" : true,
4+
"noImplicitThis" : true,
5+
"alwaysStrict" : true,
6+
"strictNullChecks" : true,
7+
"target": "lua",
8+
}
9+
}

test/runner.ts

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import { TestSet, TestRunner } from "alsatian";
2+
import { TapBark } from "tap-bark";
3+
4+
// create test set
5+
const testSet = TestSet.create();
6+
7+
// add your tests
8+
testSet.addTestsFromFiles("./**/*.spec.js");
9+
10+
// create a test runner
11+
const testRunner = new TestRunner();
12+
13+
// setup the output
14+
testRunner.outputStream
15+
// this will use alsatian's default output if you remove this
16+
// you'll get TAP or you can add your favourite TAP reporter in it's place
17+
.pipe(TapBark.create().getPipeable())
18+
// pipe to the console
19+
.pipe(process.stdout);
20+
21+
// run the test set
22+
testRunner.run(testSet);
23+
// this will be called after all tests have been run
24+
//.then((results) => done())
25+
// this will be called if there was a problem
26+
//.catch((error) => doSomethingWith(error));

0 commit comments

Comments
 (0)