typescript, es6, jest working
This commit is contained in:
parent
03bc94ff81
commit
bc218ceecd
6387
package-lock.json
generated
6387
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
18
package.json
18
package.json
@ -4,11 +4,25 @@
|
||||
"description": "",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
"test": "jest --watch"
|
||||
},
|
||||
"author": "",
|
||||
"license": "ISC",
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.6.4",
|
||||
"@babel/preset-env": "^7.6.3",
|
||||
"@babel/preset-typescript": "^7.6.0",
|
||||
"@types/jest": "^24.0.21",
|
||||
"babel-jest": "^24.9.0",
|
||||
"jest": "^24.9.0",
|
||||
"ts-jest": "^24.1.0",
|
||||
"typescript": "^3.6.2"
|
||||
}
|
||||
},
|
||||
"babel": {
|
||||
"presets": [
|
||||
"@babel/preset-env",
|
||||
"@babel/preset-typescript"
|
||||
]
|
||||
},
|
||||
"dependencies": {}
|
||||
}
|
||||
|
26
table.test.ts
Normal file
26
table.test.ts
Normal file
@ -0,0 +1,26 @@
|
||||
import {Table, Sum} from './table';
|
||||
|
||||
describe("table library", ()=>
|
||||
{
|
||||
|
||||
var table: Table;
|
||||
var rows: Array<Array<string>>;
|
||||
var summationColumns: Array<number>;
|
||||
|
||||
rows = [
|
||||
["a","1"],
|
||||
["b","2"],
|
||||
["a","3"],
|
||||
["b","1"],
|
||||
["a","2"],
|
||||
["b","3"],
|
||||
];
|
||||
summationColumns = [1];
|
||||
table = new Table("Root", rows, summationColumns);
|
||||
|
||||
it("should create a table", ()=>
|
||||
{
|
||||
expect(table.Name).toEqual("Root");
|
||||
expect(table.Rows).toEqual(rows);
|
||||
});
|
||||
})
|
Loading…
Reference in New Issue
Block a user