added tests
parent
590afef989
commit
6b3385af6a
|
@ -20,4 +20,6 @@ dist
|
||||||
npm-debug.log*
|
npm-debug.log*
|
||||||
yarn-debug.log*
|
yarn-debug.log*
|
||||||
yarn-error.log*
|
yarn-error.log*
|
||||||
example/package-lock.json
|
example/package-lock.json
|
||||||
|
|
||||||
|
coverage
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "Jest file",
|
"name": "Jest file",
|
||||||
"type": "pwa-node",
|
"type": "node",
|
||||||
"request": "launch",
|
"request": "launch",
|
||||||
"runtimeExecutable": "${workspaceRoot}/node_modules/.bin/jest",
|
"runtimeExecutable": "${workspaceRoot}/node_modules/.bin/jest",
|
||||||
"args": ["${fileBasenameNoExtension}", "--runInBand", "--watch", "--coverage=false", "--no-cache"],
|
"args": ["${fileBasenameNoExtension}", "--runInBand", "--watch", "--coverage=false", "--no-cache"],
|
||||||
|
|
|
@ -3,5 +3,14 @@
|
||||||
"^.+\\.(t|j)sx?$": "ts-jest"
|
"^.+\\.(t|j)sx?$": "ts-jest"
|
||||||
},
|
},
|
||||||
"testRegex": "(/__tests__/.*|(\\.|/)(test|spec))\\.(jsx?|tsx?)$",
|
"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": {
|
"devDependencies": {
|
||||||
"@types/jest": "^29.4.0",
|
"@types/jest": "^29.4.0",
|
||||||
"jest": "^29.4.1",
|
"jest": "^29.4.1",
|
||||||
|
"jest-environment-jsdom": "^29.4.2",
|
||||||
"prettier": "^2.8.3",
|
"prettier": "^2.8.3",
|
||||||
"ts-jest": "^29.0.5",
|
"ts-jest": "^29.0.5",
|
||||||
"tslint": "^6.1.3",
|
"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