added tests
parent
590afef989
commit
6b3385af6a
|
@ -21,3 +21,5 @@ npm-debug.log*
|
|||
yarn-debug.log*
|
||||
yarn-error.log*
|
||||
example/package-lock.json
|
||||
|
||||
coverage
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "Jest file",
|
||||
"type": "pwa-node",
|
||||
"type": "node",
|
||||
"request": "launch",
|
||||
"runtimeExecutable": "${workspaceRoot}/node_modules/.bin/jest",
|
||||
"args": ["${fileBasenameNoExtension}", "--runInBand", "--watch", "--coverage=false", "--no-cache"],
|
||||
|
|
|
@ -3,5 +3,14 @@
|
|||
"^.+\\.(t|j)sx?$": "ts-jest"
|
||||
},
|
||||
"testRegex": "(/__tests__/.*|(\\.|/)(test|spec))\\.(jsx?|tsx?)$",
|
||||
"moduleFileExtensions": ["ts", "tsx", "js", "jsx", "json", "node"]
|
||||
"moduleFileExtensions": ["ts", "tsx", "js", "jsx", "json", "node"],
|
||||
"collectCoverage": false,
|
||||
"coverageThreshold": {
|
||||
"global": {
|
||||
"branches": 50,
|
||||
"functions": 50,
|
||||
"lines": 50,
|
||||
"statements": 50
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -45,6 +45,7 @@
|
|||
"devDependencies": {
|
||||
"@types/jest": "^29.4.0",
|
||||
"jest": "^29.4.1",
|
||||
"jest-environment-jsdom": "^29.4.2",
|
||||
"prettier": "^2.8.3",
|
||||
"ts-jest": "^29.0.5",
|
||||
"tslint": "^6.1.3",
|
||||
|
|
|
@ -0,0 +1,15 @@
|
|||
/**
|
||||
* @jest-environment jsdom
|
||||
*/
|
||||
|
||||
import { fetch, invalidate } from "../client";
|
||||
|
||||
test("Tuitio empty storage", () => {
|
||||
const result = fetch();
|
||||
expect(result.token).toBeNull();
|
||||
expect(result.userName).toBeNull();
|
||||
});
|
||||
|
||||
test("Tuitio storage invalidation", () => {
|
||||
expect(invalidate()).toBe(void 0);
|
||||
});
|
Loading…
Reference in New Issue