Skip to content

Commit

Permalink
fix: remove conflict with unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
maelgangloff committed May 3, 2024
1 parent 723a277 commit b2f518e
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"extends": "standard-with-typescript",
"parserOptions": {
"project": "./tsconfig.json"
"project": ["./tsconfig.json", "./tsconfig.test.json"]
},
"rules": {
"@typescript-eslint/consistent-type-imports": "error",
Expand Down
3 changes: 2 additions & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,6 @@ module.exports = {
},
transformIgnorePatterns: [
"<rootDir>/node_modules/(?!ts-json-schema-generator)"
]
],
modulePathIgnorePatterns: ["<rootDir>/dist/"]
};
4 changes: 2 additions & 2 deletions test/user.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { Skolengo } from '../src/index'
import Ajv from 'ajv'

const SKOLENGO_TOKENSET = process.env.SKOLENGO_TOKENSET
const describeIfLoggedIn = SKOLENGO_TOKENSET !== undefined ? describe : describe.skip
const describeAuthenticated = SKOLENGO_TOKENSET !== undefined ? describe : describe.skip

const ajv = new Ajv()

Expand All @@ -17,7 +17,7 @@ const ajvConfig: Config = {
/**
* Tests unitaires des endpoints qui nécessitent une authentification
*/
describeIfLoggedIn('Test Skolengo API types - User logged in', () => {
describeAuthenticated('Test Skolengo API types - User logged in', () => {
let user: Skolengo
let userPermissions: string[] = []

Expand Down
3 changes: 1 addition & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
"node_modules"
],
"include": [
"src/",
"test/"
"src/"
]
}
17 changes: 17 additions & 0 deletions tsconfig.test.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"compilerOptions": {
"target": "esnext",
"strict": true,
"moduleResolution": "Node",
"module": "CommonJS",
"esModuleInterop": true,
"skipLibCheck": true
},
"exclude": [
"node_modules"
],
"include": [
"test/"
]
}

0 comments on commit b2f518e

Please sign in to comment.