Skip to content

Commit

Permalink
chore: adding e2e testing
Browse files Browse the repository at this point in the history
  • Loading branch information
patrickhousley committed Jul 7, 2024
1 parent d175c74 commit f8aa143
Show file tree
Hide file tree
Showing 8 changed files with 80 additions and 0 deletions.
18 changes: 18 additions & 0 deletions e2e/node/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"extends": ["../../.eslintrc.json"],
"ignorePatterns": ["!**/*"],
"overrides": [
{
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
"rules": {}
},
{
"files": ["*.ts", "*.tsx"],
"rules": {}
},
{
"files": ["*.js", "*.jsx"],
"rules": {}
}
]
}
17 changes: 17 additions & 0 deletions e2e/node/jest.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/* eslint-disable */
export default {
displayName: 'node',
preset: '../../jest.preset.js',
setupFiles: ['<rootDir>/src/test-setup.ts'],
testEnvironment: 'node',
transform: {
'^.+\\.[tj]s$': [
'ts-jest',
{
tsconfig: '<rootDir>/tsconfig.spec.json',
},
],
},
moduleFileExtensions: ['ts', 'js', 'html'],
coverageDirectory: '../../coverage/node-e2e',
}
8 changes: 8 additions & 0 deletions e2e/node/project.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"name": "node",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"sourceRoot": "e2e/node",
"projectType": "application",
"implicitDependencies": ["parser"],
"targets": {}
}
5 changes: 5 additions & 0 deletions e2e/node/src/node/node.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
describe('CLI tests', () => {
it('should print a message', () => {
expect(true).toEqual(true)
})
})
1 change: 1 addition & 0 deletions e2e/node/src/test-setup.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
//
13 changes: 13 additions & 0 deletions e2e/node/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"extends": "../../tsconfig.base.json",
"files": [],
"include": [],
"references": [
{
"path": "./tsconfig.spec.json"
}
],
"compilerOptions": {
"esModuleInterop": true
}
}
9 changes: 9 additions & 0 deletions e2e/node/tsconfig.spec.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"outDir": "../..//dist/out-tsc",
"module": "commonjs",
"types": ["jest", "node"]
},
"include": ["jest.config.ts", "src/**/*.ts"]
}
9 changes: 9 additions & 0 deletions nx.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,18 @@
},
{
"plugin": "@nx/jest/plugin",
"exclude": ["e2e/**/*"],
"options": {
"targetName": "test"
}
},
{
"plugin": "@nx/jest/plugin",
"include": ["e2e/**/*"],
"options": {
"targetName": "e2e-local",
"ciTargetName": "e2e-ci"
}
}
]
}

0 comments on commit f8aa143

Please sign in to comment.