Skip to content

Commit

Permalink
Updated most packages to newer versions (#1205)
Browse files Browse the repository at this point in the history
  • Loading branch information
ninadbstack authored Oct 21, 2024
1 parent d646a61 commit c9f50b0
Show file tree
Hide file tree
Showing 8 changed files with 2,138 additions and 2,112 deletions.
13 changes: 0 additions & 13 deletions .eslintrc

This file was deleted.

19 changes: 19 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import globals from "globals";
import pluginJs from "@eslint/js";
import jasmine from "eslint-plugin-jasmine"


export default [
{files: ["**/*.js"], languageOptions: {sourceType: "commonjs"}},
jasmine.configs.recommended,
{languageOptions: {
globals: {
...globals.browser,
...globals.node,
browser: 'readonly',
driver: 'readonly',
}
},
plugins: {jasmine}
},
];
3 changes: 1 addition & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ module.exports = function percySnapshot(b, name, options) {
// Serialize and capture the DOM
/* istanbul ignore next: no instrumenting injected code */
let { domSnapshot, url } = await b.execute(options => ({
/* eslint-disable-next-line no-undef */
domSnapshot: PercyDOM.serialize(options),
url: document.URL
}), options);
Expand Down Expand Up @@ -78,6 +77,6 @@ module.exports.request = async function request(data) {

// jasmine cannot mock individual functions, hence adding isPercyEnabled to the exports object
// also need to define this at the end of the file or else default exports will over-ride this
module.exports.isPercyEnabled = async function isPercyEnabled(driver) {
module.exports.isPercyEnabled = async function isPercyEnabled() {
return await utils.isPercyEnabled();
};
31 changes: 17 additions & 14 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,35 +20,38 @@
"node": ">=14"
},
"scripts": {
"lint": "eslint --ignore-path .gitignore .",
"lint": "eslint --ignore-pattern .gitignore .",
"test": "percy exec --testing -- wdio wdio.conf.js",
"test:coverage": "nyc yarn test",
"test:types": "tsd"
},
"dependencies": {
"@percy/sdk-utils": "^1.28.1"
"@percy/sdk-utils": "^1.30.1"
},
"peerDependencies": {
"webdriverio": "~6 || ~7 || ~8 || ~ 9"
},
"devDependencies": {
"@percy/cli": "^1.28.1",
"@wdio/cli": "^7.0.8",
"@wdio/jasmine-framework": "^7.24.0",
"@wdio/local-runner": "^7.0.0",
"@wdio/spec-reporter": "^7.0.0",
"eslint": "^7.11.0",
"eslint-config-standard": "^16.0.2",
"eslint-plugin-import": "^2.22.1",
"@eslint/js": "^9.13.0",
"@percy/cli": "^1.30.1",
"@wdio/cli": "^9.2.1",
"@wdio/jasmine-framework": "^9.2.1",
"@wdio/local-runner": "^9.2.1",
"@wdio/spec-reporter": "^9.1.3",
"eslint": "^9.13.0",
"eslint-config-standard": "^17.1.0",
"eslint-plugin-import": "^2.31.0",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-promise": "^5.1.0",
"eslint-plugin-promise": "^7.1.0",
"eslint-plugin-standard": "^5.0.0",
"eslint-plugin-jasmine": "^4.2.2",
"geckodriver": "^3.0.1",
"globals": "^15.11.0",
"jasmine": "^5.4.0",
"nyc": "^15.1.0",
"nyc": "^17.1.0",
"ts-node": "^10.9.1",
"tsd": "^0.24.1",
"typescript": "^4.2.3",
"tsd": "^0.31.2",
"typescript": "^5.6.3",
"webdriverio": "^9.2.1"
}
}
4 changes: 0 additions & 4 deletions test/.eslintrc

This file was deleted.

17 changes: 17 additions & 0 deletions test/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import globals from "globals";
import pluginJs from "@eslint/js";


export default [
{files: ["**/*.js"], languageOptions: {sourceType: "commonjs"}},
{languageOptions: {
globals: {
...globals.browser,
...globals.node,
browser: 'readonly',
driver: 'readonly',
}
}
},
pluginJs.configs.recommended,
];
4 changes: 3 additions & 1 deletion test/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ describe('percySnapshot', () => {
'snapshot-name': 'Snapshot 1',
status: 'success'
});

expect(mockedPostCall).toHaveBeenCalledTimes(1);
});

Expand Down Expand Up @@ -105,7 +106,7 @@ describe('percySnapshot', () => {
});

it('throws error for percy on automate session', async () => {
spyOn(percySnapshot, 'isPercyEnabled').and.returnValue(Promise.resolve(true));
spyOn(percySnapshot, 'isPercyEnabled').and.resolveTo(true);
utils.percy.type = 'automate';

let error = null;
Expand All @@ -114,6 +115,7 @@ describe('percySnapshot', () => {
} catch (e) {
error = e.message;
}

expect(error).toEqual('You are using Percy on Automate session with WebdriverIO. For using WebdriverIO correctly, please use https://github.com/percy/percy-selenium-js/ or https://github.com/percy/percy-appium-js/');
});
});
Loading

0 comments on commit c9f50b0

Please sign in to comment.