Skip to content

Commit

Permalink
swap to deepmerge package
Browse files Browse the repository at this point in the history
  • Loading branch information
Tanner Reits committed Apr 15, 2024
1 parent 0986956 commit 2893d4b
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 28 deletions.
15 changes: 13 additions & 2 deletions cspell.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,15 @@
{
"ignorePaths": ["**/node_modules/**", "**/third-party/**"],
"words": ["appload", "domcontentloaded", "networkidle", "outfile", "tada", "upvote"]
"ignorePaths": [
"**/node_modules/**",
"**/third-party/**"
],
"words": [
"appload",
"deepmerge",
"domcontentloaded",
"networkidle",
"outfile",
"tada",
"upvote"
]
}
24 changes: 4 additions & 20 deletions package-lock.json

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

5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@
"@stencil/core": "^4.13.0",
"@types/eslint": "^8.56.2",
"@types/jest": "^29.5.12",
"@types/lodash.merge": "^4.6.9",
"@types/node": "^20.11.19",
"@typescript-eslint/eslint-plugin": "^7.0.2",
"@typescript-eslint/parser": "^7.0.2",
Expand All @@ -72,7 +71,7 @@
},
"prettier": "@ionic/prettier-config",
"dependencies": {
"glob": "^10.3.10",
"lodash.merge": "^4.6.2"
"deepmerge": "^4.3.1",
"glob": "^10.3.10"
}
}
8 changes: 5 additions & 3 deletions src/create-config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { PlaywrightTestConfig } from '@playwright/test';
import merge from 'lodash.merge';
import merge from 'deepmerge';

import { loadConfigMeta } from './load-config-meta';
import { ProcessConstants } from './process-constants';
Expand All @@ -20,7 +20,9 @@ type DeepPartial<T> = T extends object
* @param overrides Values to override in the default config. Any Playwright config option can be overridden.
* @returns A {@link PlaywrightTestConfig} object
*/
export const createConfig = async (overrides?: DeepPartial<PlaywrightTestConfig>): Promise<PlaywrightTestConfig> => {
export const createConfig = async (
overrides: DeepPartial<PlaywrightTestConfig> = {},
): Promise<PlaywrightTestConfig> => {
const { webServerUrl, baseURL, stencilEntryPath, stencilNamespace } = await loadConfigMeta();

// Set the Stencil namespace and entry path as environment variables so we can use them when constructing
Expand All @@ -29,7 +31,7 @@ export const createConfig = async (overrides?: DeepPartial<PlaywrightTestConfig>
process.env[ProcessConstants.STENCIL_NAMESPACE] = stencilNamespace;
process.env[ProcessConstants.STENCIL_ENTRY_PATH] = stencilEntryPath;

return merge(
return merge<DeepPartial<PlaywrightTestConfig>>(
{
testMatch: '*.e2e.ts',
use: {
Expand Down

0 comments on commit 2893d4b

Please sign in to comment.