diff --git a/libs/testing/e2e/.eslintrc.json b/libs/testing/e2e/.eslintrc.json new file mode 100644 index 000000000000..3456be9b9036 --- /dev/null +++ b/libs/testing/e2e/.eslintrc.json @@ -0,0 +1,18 @@ +{ + "extends": ["../../../.eslintrc.json"], + "ignorePatterns": ["!**/*"], + "overrides": [ + { + "files": ["*.ts", "*.tsx", "*.js", "*.jsx"], + "rules": {} + }, + { + "files": ["*.ts", "*.tsx"], + "rules": {} + }, + { + "files": ["*.js", "*.jsx"], + "rules": {} + } + ] +} diff --git a/libs/testing/e2e/README.md b/libs/testing/e2e/README.md new file mode 100644 index 000000000000..f5b4b36b7919 --- /dev/null +++ b/libs/testing/e2e/README.md @@ -0,0 +1,7 @@ +# libs/testing/e2e + +This library was generated with [Nx](https://nx.dev). + +## Running unit tests + +Run `nx test libs/testing/e2e` to execute the unit tests via [Jest](https://jestjs.io). diff --git a/libs/testing/e2e/jest.config.ts b/libs/testing/e2e/jest.config.ts new file mode 100644 index 000000000000..c825cd0ac83c --- /dev/null +++ b/libs/testing/e2e/jest.config.ts @@ -0,0 +1,11 @@ +/* eslint-disable */ +export default { + displayName: 'libs/testing/e2e', + preset: '../../../jest.preset.js', + testEnvironment: 'node', + transform: { + '^.+\\.[tj]s$': ['ts-jest', { tsconfig: '/tsconfig.spec.json' }], + }, + moduleFileExtensions: ['ts', 'js', 'html'], + coverageDirectory: '../../../coverage/libs/testing/e2e', +} diff --git a/libs/testing/e2e/project.json b/libs/testing/e2e/project.json new file mode 100644 index 000000000000..c40725ab3210 --- /dev/null +++ b/libs/testing/e2e/project.json @@ -0,0 +1,19 @@ +{ + "name": "testing-e2e", + "$schema": "../../../node_modules/nx/schemas/project-schema.json", + "sourceRoot": "libs/testing/e2e/src", + "projectType": "library", + "tags": ["lib:react", "scope:react"], + "targets": { + "lint": { + "executor": "@nx/eslint:lint" + }, + "test": { + "executor": "@nx/jest:jest", + "outputs": ["{workspaceRoot}/coverage/libs/testing/e2e"], + "options": { + "jestConfig": "libs/testing/e2e/jest.config.ts" + } + } + } +} diff --git a/libs/testing/e2e/src/index.ts b/libs/testing/e2e/src/index.ts new file mode 100644 index 000000000000..88dfe575adfc --- /dev/null +++ b/libs/testing/e2e/src/index.ts @@ -0,0 +1 @@ +export * from './lib/libs/testing/e2e' diff --git a/libs/testing/e2e/src/lib/libs/testing/e2e.spec.ts b/libs/testing/e2e/src/lib/libs/testing/e2e.spec.ts new file mode 100644 index 000000000000..64546b648ec3 --- /dev/null +++ b/libs/testing/e2e/src/lib/libs/testing/e2e.spec.ts @@ -0,0 +1,7 @@ +import { libsTestingE2e } from './e2e' + +describe('libsTestingE2e', () => { + it('should work', () => { + expect(libsTestingE2e()).toEqual('libs/testing/e2e') + }) +}) diff --git a/libs/testing/e2e/src/lib/libs/testing/e2e.ts b/libs/testing/e2e/src/lib/libs/testing/e2e.ts new file mode 100644 index 000000000000..ead5b58b4769 --- /dev/null +++ b/libs/testing/e2e/src/lib/libs/testing/e2e.ts @@ -0,0 +1,3 @@ +export function libsTestingE2e(): string { + return 'libs/testing/e2e' +} diff --git a/libs/testing/e2e/tsconfig.json b/libs/testing/e2e/tsconfig.json new file mode 100644 index 000000000000..25f7201d870e --- /dev/null +++ b/libs/testing/e2e/tsconfig.json @@ -0,0 +1,16 @@ +{ + "extends": "../../../tsconfig.base.json", + "compilerOptions": { + "module": "commonjs" + }, + "files": [], + "include": [], + "references": [ + { + "path": "./tsconfig.lib.json" + }, + { + "path": "./tsconfig.spec.json" + } + ] +} diff --git a/libs/testing/e2e/tsconfig.lib.json b/libs/testing/e2e/tsconfig.lib.json new file mode 100644 index 000000000000..e583571eac87 --- /dev/null +++ b/libs/testing/e2e/tsconfig.lib.json @@ -0,0 +1,11 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "module": "commonjs", + "outDir": "../../../dist/out-tsc", + "declaration": true, + "types": ["node"] + }, + "exclude": ["jest.config.ts", "src/**/*.spec.ts", "src/**/*.test.ts"], + "include": ["src/**/*.ts"] +} diff --git a/libs/testing/e2e/tsconfig.spec.json b/libs/testing/e2e/tsconfig.spec.json new file mode 100644 index 000000000000..69a251f328ce --- /dev/null +++ b/libs/testing/e2e/tsconfig.spec.json @@ -0,0 +1,14 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "outDir": "../../../dist/out-tsc", + "module": "commonjs", + "types": ["jest", "node"] + }, + "include": [ + "jest.config.ts", + "src/**/*.test.ts", + "src/**/*.spec.ts", + "src/**/*.d.ts" + ] +} diff --git a/tsconfig.base.json b/tsconfig.base.json index 36a85729ce40..8b5da3e7139f 100644 --- a/tsconfig.base.json +++ b/tsconfig.base.json @@ -1112,6 +1112,7 @@ ], "@island.is/skilavottord/types": ["libs/skilavottord/types/src/index.ts"], "@island.is/testing/containers": ["libs/testing/containers/src/index.ts"], + "@island.is/testing/e2e": ["libs/testing/e2e/src/index.ts"], "@island.is/testing/fixtures": ["libs/testing/fixtures/src/index.ts"], "@island.is/testing/nest": ["libs/testing/nest/src/index.ts"], "@island.is/university-gateway": ["libs/university-gateway/src/index.ts"],