mirror of
https://dev.azure.com/tstanciu94/Packages/_git/tuitio-client
synced 2025-03-30 04:21:40 +03:00
added tests
This commit is contained in:
parent
590afef989
commit
6b3385af6a
4
.gitignore
vendored
4
.gitignore
vendored
@ -20,4 +20,6 @@ dist
|
||||
npm-debug.log*
|
||||
yarn-debug.log*
|
||||
yarn-error.log*
|
||||
example/package-lock.json
|
||||
example/package-lock.json
|
||||
|
||||
coverage
|
2
.vscode/launch.json
vendored
2
.vscode/launch.json
vendored
@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
1191
package-lock.json
generated
1191
package-lock.json
generated
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",
|
||||
|
15
src/__tests__/TuitioStorage.test.ts
Normal file
15
src/__tests__/TuitioStorage.test.ts
Normal file
@ -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…
x
Reference in New Issue
Block a user