Skip to content

Commit

Permalink
add: tests unitaires
Browse files Browse the repository at this point in the history
  • Loading branch information
camarm-dev committed Feb 27, 2024
1 parent 40cb25f commit 8de0ee9
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 1 deletion.
4 changes: 4 additions & 0 deletions jest.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"preset": "ts-jest",
"testEnvironment": "node"
}
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"types": "index.d.ts",
"module": "index.mjs",
"scripts": {
"test": "echo \"Error: no test specified\"",
"test": "jest",
"lint": "eslint --no-eslintrc -c .eslintrc.json .",
"lint:fix": "eslint --no-eslintrc -c .eslintrc.json --fix .",
"build": "npm run lint && tspc --project tsconfig.json",
Expand All @@ -32,13 +32,16 @@
],
"devDependencies": {
"@stylistic/eslint-plugin": "^1.5.3",
"@types/jest": "^29.5.12",
"@typescript-eslint/parser": "^6.18.0",
"eslint": "^8.56.0",
"eslint-config-standard-with-typescript": "^43.0.1",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-n": "^16.6.2",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-promise": "^6.1.1",
"jest": "^29.7.0",
"ts-jest": "^29.1.2",
"typescript": "^5.3.3",
"typescript-transform-path-rewrite": "^1.3.0"
},
Expand Down
9 changes: 9 additions & 0 deletions tests/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Tests

Ces tests sont exécutables avec la commande `npm run test`. Ces tests utilisent `jest`.

Ils utilisent un serveur [ed-test-api](https://github.com/camarm-dev/ed-test-api) pour fonctionner.

**TODOs:**
- Implémenter ed-test-api
- Tester toutes les fonctionnalités
8 changes: 8 additions & 0 deletions tests/index.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { EDCore } from "../index";
import {Session} from "../src/session";

describe('index.ts', () => {
test('should export EDCore class, which is a Session instance', () => {
expect(typeof EDCore).toBe(typeof Session)
})
})

0 comments on commit 8de0ee9

Please sign in to comment.