Skip to content

Commit

Permalink
refactor(e2e): rename e2e files for clarity
Browse files Browse the repository at this point in the history
- Moves contents of `test/*` to `test/e2e/*`
- Renames `test/tsconfig.json` to `test/e2e/tsconfig.wdio.json`
- Removes redundant eslint rules, and fixes eslint errors for `*.e2e.ts` files
  - Updates `tsconfig.eslint.json` to extend `tsconfig.wdio.json`
- Renames e2e test files to end with `.spec.ts` instead of `.e2e.ts`

Signed-off-by: Zacharias Fragkiadakis <zacfragkiadakis@gmail.com>
  • Loading branch information
QZera committed Nov 26, 2024
1 parent 46e5cc3 commit 65e82f4
Show file tree
Hide file tree
Showing 9 changed files with 10 additions and 22 deletions.
12 changes: 0 additions & 12 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -390,18 +390,6 @@ module.exports = {
'no-only-tests/no-only-tests': 'warn',
},
},
{
/*
* Rules specifically for end-to-end test files
* ======================================================================================
*/
files: ['test/specs/*.e2e.ts', 'test/specs/*.e2e.js'],
rules: {
// prevent errors on expect assertions (e.g. `expect(...).toBe(...)`)
'@typescript-eslint/no-unsafe-member-access': 'off',
'@typescript-eslint/no-unsafe-call': 'off',
},
},
{
/*
* Rules specifically for common js config files
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ debug.log*

# wdio
.wdio-vscode-service
test/.cache
test/e2e/.cache
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
"test:typings:extension": "tsc --noEmit",
"test:typings:webviews": "cd ./src/webviews && npm run type-check",
"test:unit": "echo \"Unit testing not yet implemented.\"",
"test:e2e": "wdio run ./test/wdio.conf.ts"
"test:e2e": "wdio run ./test/e2e/wdio.conf.ts"
},
"main": "./dist/extension.js",
"activationEvents": [
Expand Down Expand Up @@ -615,4 +615,4 @@
"pre-commit": "npm run lint"
},
"private": true
}
}
2 changes: 1 addition & 1 deletion test/constants/config.ts → test/e2e/constants/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ import { join } from 'node:path'
* The path to the e2e test directory. Used to create temporary directories and
* files for testing.
*/
export const e2eTestDirPath = join(__dirname, '..')
export const e2eTestDirPath = join(__dirname, '...')
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import path from 'node:path'
import { browser, expect } from '@wdio/globals'
import { e2eTestDirPath } from 'test/constants/config'
import { e2eTestDirPath } from 'test/e2e/constants/config'
import type { ViewSection, Workbench } from 'wdio-vscode-service'
import { $, cd } from 'zx'

Expand Down
4 changes: 2 additions & 2 deletions test/tsconfig.json → test/e2e/tsconfig.wdio.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": "../tsconfig.json",
"extends": "../../tsconfig.json",
"compilerOptions": {
"types": [
"node",
Expand All @@ -9,4 +9,4 @@
"wdio-vscode-service"
]
}
}
}
2 changes: 1 addition & 1 deletion test/wdio.conf.ts → test/e2e/wdio.conf.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const vscodeVersion = (packageJson.engines.vscode as string).replace(/^\^/, '')

export const config: WebdriverIO.Config = {
runner: 'local',
tsConfigPath: './tsconfig.json',
tsConfigPath: './tsconfig.wdio.json',
specs: ['./specs/**/*.ts'],
maxInstances: 10,
capabilities: [
Expand Down
4 changes: 2 additions & 2 deletions tsconfig.eslint.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
"compilerOptions": {
"noEmit": true,
"incremental": false,
},
"extends": "./tsconfig.json",
},
"extends": "./test/e2e/tsconfig.wdio.json",
"include": [
"./**.js",
"./**/*.ts",
Expand Down

0 comments on commit 65e82f4

Please sign in to comment.