Skip to content

Commit 14c26ea

Browse files
authored
Added a testing suite (#8)
Tests now look for any *.spec.ts files. Added a sample spec to image-diff.
1 parent 555cc83 commit 14c26ea

File tree

4 files changed

+184
-8
lines changed

4 files changed

+184
-8
lines changed

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,8 @@ js/**/*
66
# Temporary files generated by code
77
temp/**/*
88

9+
# Yarn Logs
10+
yarn-error.log
11+
912
# Git conventions
1013
!.gitkeep

package.json

+9-3
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
"main": "index.js",
55
"license": "MIT",
66
"scripts": {
7-
"dev": "nodemon ./js/index.js"
7+
"dev": "nodemon ./js/index.js",
8+
"test": "mocha \"./{,!(node_modules)/**/}*.spec.ts\" --require ts-node/register -O spec"
89
},
910
"dependencies": {
1011
"express": "^4.16.2",
@@ -13,9 +14,14 @@
1314
"puppeteer": "^0.12.0"
1415
},
1516
"devDependencies": {
17+
"@types/chai": "^4.0.4",
1618
"@types/express": "^4.0.38",
19+
"@types/mocha": "^2.2.43",
1720
"@types/node": "^8.0.47",
18-
"typescript": "^2.5.3",
19-
"nodemon": "^1.12.1"
21+
"chai": "^4.1.2",
22+
"mocha": "^4.0.1",
23+
"nodemon": "^1.12.1",
24+
"ts-node": "^3.3.0",
25+
"typescript": "^2.5.3"
2026
}
2127
}

routes/image-diff/index.spec.ts

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import { assert } from "chai"
2+
3+
describe("Image Diff", () => {
4+
it("should work just fine", () => {
5+
assert.isTrue(true)
6+
})
7+
})

0 commit comments

Comments
 (0)