Skip to content

Commit

Permalink
(feat): allow wdio config to be in a sub directory
Browse files Browse the repository at this point in the history
  • Loading branch information
christian-bromann committed Oct 9, 2023
1 parent 2ca09b3 commit 7f2d380
Show file tree
Hide file tree
Showing 7 changed files with 36 additions and 47 deletions.
1 change: 1 addition & 0 deletions example-cjs/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 21 additions & 0 deletions example/e2e/config/wdio.conf.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import fs from 'node:fs';
import url from 'node:url';
import path from 'node:path';

import { getBinaryPath } from 'wdio-electron-service/utils';

Check failure on line 5 in example/e2e/config/wdio.conf.ts

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest, 16.x)

'getBinaryPath' is defined but never used
import { config as baseConfig } from '../../wdio.conf.js';

const __dirname = path.dirname(url.fileURLToPath(import.meta.url));
const rootDir = path.join(__dirname, '..', '..')
const packageJson = JSON.parse(fs.readFileSync(path.join(rootDir, 'package.json')).toString());

const {
build: { productName },

Check failure on line 13 in example/e2e/config/wdio.conf.ts

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest, 16.x)

'productName' is assigned a value but never used
} = packageJson;

process.env.TEST = 'true';

export const config = {
...baseConfig,
specs: ['../*.spec.ts'],
}
2 changes: 1 addition & 1 deletion example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"ci": "pnpm i && pnpm build && pnpm test",
"clean": "pnpm clean:dist && rm -rf ./node_modules pnpm-lock.yaml ./all-logs",
"clean:dist": "pnpx rimraf ./dist && mkdir -p ./dist",
"test": "wdio run ./wdio.conf.ts"
"test": "wdio run ./wdio.conf.ts && wdio run ./e2e/config/wdio.conf.ts"
},
"devDependencies": {
"@rollup/plugin-commonjs": "^25.0.4",
Expand Down
1 change: 1 addition & 0 deletions example/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,8 @@
"debug": "^4.3.4",
"electron-to-chromium": "^1.4.532",
"find-versions": "^5.1.0",
"node-fetch": "^3.3.2"
"node-fetch": "^3.3.2",
"read-pkg-up": "^10.1.0"
},
"devDependencies": {
"@eslint/js": "^8.50.0",
Expand Down
44 changes: 3 additions & 41 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 7f2d380

Please sign in to comment.