Merge branch '5-create-basic-testing-setup' into 'main'
Resolve "Create basic testing setup." Closes #5 See merge request finvis/usxi!5
This commit is contained in:
commit
093fa54126
@ -1,3 +1,4 @@
|
|||||||
dist
|
dist
|
||||||
node_modules
|
node_modules
|
||||||
.eslintrc.js
|
.eslintrc.js
|
||||||
|
jest.config.ts
|
@ -3,7 +3,7 @@ module.exports = {
|
|||||||
parserOptions: {
|
parserOptions: {
|
||||||
ecmaVersion: "latest", // Allows the use of modern ECMAScript features
|
ecmaVersion: "latest", // Allows the use of modern ECMAScript features
|
||||||
sourceType: "module", // Allows for the use of imports
|
sourceType: "module", // Allows for the use of imports
|
||||||
project: "./tsconfig.json"
|
project: ["./tsconfig.json", "./tsconfig.test.json"]
|
||||||
},
|
},
|
||||||
extends: ["plugin:@typescript-eslint/recommended"], // Uses the linting rules from @typescript-eslint/eslint-plugin
|
extends: ["plugin:@typescript-eslint/recommended"], // Uses the linting rules from @typescript-eslint/eslint-plugin
|
||||||
env: {
|
env: {
|
||||||
|
13
jest.config.ts
Normal file
13
jest.config.ts
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
import type { Config } from '@jest/types'
|
||||||
|
|
||||||
|
const config: Config.InitialOptions =
|
||||||
|
{
|
||||||
|
transform:
|
||||||
|
{
|
||||||
|
'^.+\\.tsx?$': 'ts-jest',
|
||||||
|
},
|
||||||
|
|
||||||
|
collectCoverageFrom: ['src/*.ts'],
|
||||||
|
}
|
||||||
|
|
||||||
|
export default config
|
3324
package-lock.json
generated
3324
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -5,16 +5,22 @@
|
|||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"start": "node dist/index.js",
|
"start": "node dist/index.js",
|
||||||
"lint": "eslint . --fix"
|
"lint": "eslint src/ --fix",
|
||||||
|
"lint-test": "eslint test/ --fix",
|
||||||
|
"test": "jest test/ --config jest.config.ts"
|
||||||
},
|
},
|
||||||
"author": "",
|
"author": "",
|
||||||
"license": "GPL-3.0-or-later",
|
"license": "GPL-3.0-or-later",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@tsconfig/node-lts": "^18.12.5",
|
"@tsconfig/node-lts": "^18.12.5",
|
||||||
|
"@types/jest": "^29.5.5",
|
||||||
"@types/node": "^20.8.2",
|
"@types/node": "^20.8.2",
|
||||||
"@typescript-eslint/eslint-plugin": "^6.7.4",
|
"@typescript-eslint/eslint-plugin": "^6.7.4",
|
||||||
"@typescript-eslint/parser": "^6.7.4",
|
"@typescript-eslint/parser": "^6.7.4",
|
||||||
"eslint": "^8.50.0",
|
"eslint": "^8.50.0",
|
||||||
|
"jest": "^29.7.0",
|
||||||
|
"ts-jest": "^29.1.1",
|
||||||
|
"ts-node": "^10.9.1",
|
||||||
"typescript": "^5.2.2"
|
"typescript": "^5.2.2"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
7
test/basic.test.ts
Normal file
7
test/basic.test.ts
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
import {describe, expect, test} from '@jest/globals';
|
||||||
|
|
||||||
|
describe('sum module', () => {
|
||||||
|
test('adds 1 + 2 to equal 3', () => {
|
||||||
|
expect(1 + 2).toBe(3);
|
||||||
|
});
|
||||||
|
});
|
8
tsconfig.test.json
Normal file
8
tsconfig.test.json
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
{
|
||||||
|
"extends": "@tsconfig/node-lts/tsconfig.json",
|
||||||
|
"compilerOptions": {
|
||||||
|
"outDir": "dist"
|
||||||
|
},
|
||||||
|
"include": ["test"],
|
||||||
|
"exclude": ["node_modules"]
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user