Skip to content

Commit

Permalink
Merge pull request #236 from Synthetixio/dev
Browse files Browse the repository at this point in the history
promote dev to master
  • Loading branch information
drptbl authored Oct 12, 2021
2 parents ebce494 + da78e81 commit 17c3f39
Show file tree
Hide file tree
Showing 9 changed files with 22,956 additions and 17,806 deletions.
3 changes: 0 additions & 3 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ module.exports = {
extends: [
'eslint:recommended',
'prettier',
// 'plugin:unicorn/recommended',
'plugin:prettier/recommended',
'plugin:import/errors',
'plugin:import/warnings',
Expand All @@ -20,7 +19,6 @@ module.exports = {
],
plugins: [
'prettier',
// 'unicorn',
'import',
'cypress',
'chai-friendly',
Expand All @@ -34,6 +32,5 @@ module.exports = {
rules: {
'no-debugger': 0,
'no-console': 0,
// 'unicorn/no-process-exit': 0,
},
};
2 changes: 1 addition & 1 deletion .github/workflows/audit_and_lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ jobs:
- name: Upload lint results
# run if lint failed and only on master/dev branch and pull requests
if: always() && (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/dev' || github.event_name == 'pull_request')
uses: github/codeql-action/upload-sarif@1b37538d9c22dd3f3d0c52992fa20da98683bd34 # pin@codeql-bundle-20210517
uses: github/codeql-action/upload-sarif@fd3190bba58b65cbefb742009518a03a07af24d7 # pin@codeql-bundle-20210517
with:
sarif_file: lint-results.sarif
continue-on-error: true
4 changes: 2 additions & 2 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ jobs:
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # pin@v2

- name: Initialize CodeQL
uses: github/codeql-action/init@1b37538d9c22dd3f3d0c52992fa20da98683bd34
uses: github/codeql-action/init@fd3190bba58b65cbefb742009518a03a07af24d7
with:
queries: security-and-quality
languages: javascript

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@1b37538d9c22dd3f3d0c52992fa20da98683bd34
uses: github/codeql-action/analyze@fd3190bba58b65cbefb742009518a03a07af24d7
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,9 @@ You can also add and switch to custom network by passing an `object` instead of

If you want to use Etherscan API helpers, you will have to provide Etherscan API key using `ETHERSCAN_KEY` enironmental variable.

If you want to fail a test if there are any browser console errors, set `FAIL_ON_ERROR` to `1` or `true`.
To fail a test if there are any browser console errors, set `FAIL_ON_ERROR` to `1` or `true`.

Automatic waiting for XHR requests to finish before tests start can be turned off with `SKIP_RESOURCES_WAIT` environmental variable, set it to `1` or `true`.

## 🧪 Usage

Expand Down
7 changes: 6 additions & 1 deletion commands/metamask.js
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,10 @@ module.exports = {
},
initialSetup: async ({ secretWordsOrPrivateKey, network, password }) => {
const isCustomNetwork =
(process.env.NETWORK_NAME && process.env.RPC_URL && process.env.CHAIN_ID) || typeof(network) == 'object';
(process.env.NETWORK_NAME &&
process.env.RPC_URL &&
process.env.CHAIN_ID) ||
typeof network == 'object';

await puppeteer.init();
await puppeteer.assignWindows();
Expand All @@ -397,8 +400,10 @@ module.exports = {
) {
await module.exports.confirmWelcomePage();
if (secretWordsOrPrivateKey.includes(' ')) {
// secret words
await module.exports.importWallet(secretWordsOrPrivateKey, password);
} else {
// private key
await module.exports.createWallet(password);
await module.exports.importFromPrivateKey(secretWordsOrPrivateKey);
}
Expand Down
40,678 changes: 22,908 additions & 17,770 deletions package-lock.json

Large diffs are not rendered by default.

41 changes: 20 additions & 21 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,50 +41,49 @@
"update:deps": "ncu -u && npm install --legacy-peer-deps"
},
"dependencies": {
"@cypress/code-coverage": "3.9.10",
"@cypress/react": "5.9.4",
"@cypress/webpack-dev-server": "1.4.0",
"@cypress/code-coverage": "3.9.11",
"@cypress/react": "5.10.1",
"@cypress/webpack-dev-server": "1.6.0",
"@synthetixio/js": "2.41.0",
"@testing-library/cypress": "8.0.0",
"@testing-library/react": "12.0.0",
"@testing-library/cypress": "8.0.1",
"@testing-library/react": "12.1.2",
"@types/puppeteer-core": "5.4.0",
"@types/testing-library__cypress": "5.0.9",
"axios": "0.21.1",
"axios": "0.22.0",
"babel-plugin-istanbul": "6.0.0",
"babel-plugin-react-generate-property": "1.0.5",
"babel-plugin-react-remove-properties": "0.3.0",
"babel-plugin-transform-react-qa-classes": "1.6.0",
"babel-plugin-transform-react-styled-components-qa": "2.0.1",
"babel-plugin-transform-react-styled-components-qa": "2.1.0",
"bytes32": "0.0.3",
"commander": "8.1.0",
"commander": "8.2.0",
"cross-zip": "4.0.0",
"cypress": "8.4.1",
"cypress": "8.6.0",
"cypress-wait-until": "1.7.1",
"eslint": "7.32.0",
"eslint-config-prettier": "8.3.0",
"eslint-config-standard": "16.0.3",
"eslint-plugin-chai-friendly": "0.7.2",
"eslint-plugin-cypress": "2.11.3",
"eslint-plugin-import": "2.24.1",
"eslint-plugin-cypress": "2.12.1",
"eslint-plugin-import": "2.25.1",
"eslint-plugin-node": "11.1.0",
"eslint-plugin-prettier": "3.4.1",
"eslint-plugin-prettier": "4.0.0",
"eslint-plugin-promise": "5.1.0",
"eslint-plugin-standard": "4.1.0",
"eslint-plugin-testing-library": "4.11.0",
"eslint-plugin-testing-library": "4.12.4",
"eslint-plugin-ui-testing": "1.0.4",
"eslint-plugin-unicorn": "35.0.0",
"etherscan-api": "10.0.5",
"node-fetch": "2.6.1",
"prettier": "2.3.2",
"puppeteer-core": "10.2.0",
"serve": "12.0.0",
"start-server-and-test": "1.13.1",
"node-fetch": "3.0.0",
"prettier": "2.4.1",
"puppeteer-core": "10.4.0",
"serve": "12.0.1",
"start-server-and-test": "1.14.0",
"synthetix-js": "2.49.0"
},
"devDependencies": {
"@microsoft/eslint-formatter-sarif": "2.1.5",
"npm-check-updates": "11.8.3",
"release-it": "14.11.5"
"npm-check-updates": "11.8.5",
"release-it": "14.11.6"
},
"engines": {
"node": ">=10"
Expand Down
19 changes: 13 additions & 6 deletions support/commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,12 @@ Cypress.Commands.add('fetchMetamaskWalletAddress', () => {

Cypress.Commands.add(
'setupMetamask',
(secretWords, network, password = 'Tester@1234') => {
return cy.task('setupMetamask', { secretWords, network, password });
(secretWordsOrPrivateKey, network, password = 'Tester@1234') => {
return cy.task('setupMetamask', {
secretWordsOrPrivateKey,
network,
password,
});
},
);

Expand Down Expand Up @@ -238,7 +242,10 @@ Cypress.Commands.add('waitForResources', (resources = []) => {
});
});

Cypress.Commands.overwrite('visit', (originalFn, url, options) => {
originalFn(url, options);
return cy.waitForResources();
});
// overwrite default cypress commands
if (!process.env.SKIP_RESOURCES_WAIT) {
Cypress.Commands.overwrite('visit', (originalFn, url, options) => {
originalFn(url, options);
return cy.waitForResources();
});
}
4 changes: 3 additions & 1 deletion support/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -171,9 +171,11 @@ declare namespace Cypress {
* @example
* cy.setupMetamask('secret, words, ...', 'kovan', 'password for metamask')
* cy.setupMetamask('secret, words, ...', {networkName: 'name', rpcUrl: 'https://url', chainId: 1, symbol: 'ETH', blockExplorer: 'https://url', isTestnet: true}, 'password for metamask')
* cy.setupMetamask('private_key', 'kovan', 'password for metamask')
* cy.setupMetamask('private_key', {networkName: 'name', rpcUrl: 'https://url', chainId: 1, symbol: 'ETH', blockExplorer: 'https://url', isTestnet: true}, 'password for metamask')
*/
setupMetamask(
secretWords: string,
secretWordsOrPrivateKey: string,
network: string | object,
password: string,
): Chainable<Subject>;
Expand Down

0 comments on commit 17c3f39

Please sign in to comment.