From d1539be8a7cfb084fb924592efb0a43c293b872a Mon Sep 17 00:00:00 2001 From: Mikhala Date: Wed, 11 Oct 2023 09:15:29 +0800 Subject: [PATCH 1/7] test ci --- packages/checkout/sdk/src/Checkout.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/checkout/sdk/src/Checkout.ts b/packages/checkout/sdk/src/Checkout.ts index e2776feb71..2b69da910e 100644 --- a/packages/checkout/sdk/src/Checkout.ts +++ b/packages/checkout/sdk/src/Checkout.ts @@ -291,6 +291,9 @@ export class Checkout { throw new Error('This endpoint is not currently available.'); } + // eslint-disable-next-line no-console + console.log('testing ci'); + // eslint-disable-next-line no-console console.warn('This endpoint is currently under construction.'); From ad12116fcc3c1afa2129f8abf32208d9a9ab7c96 Mon Sep 17 00:00:00 2001 From: Mikhala Date: Wed, 11 Oct 2023 09:45:56 +0800 Subject: [PATCH 2/7] add space increase --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 78a3a66741..df879a68d1 100644 --- a/package.json +++ b/package.json @@ -51,7 +51,7 @@ "syncpack:format": "yarn syncpack format", "test": "wsrun --exclude-missing -e test", "test:checkout:cypress": "wsrun -p @imtbl/checkout-widgets-lib --exclude-missing -e test:cypress", - "test:checkout:sdk:coverage": "wsrun -p @imtbl/checkout-sdk --exclude-missing -e test:coverage", + "test:checkout:sdk:coverage": "NODE_OPTIONS=--max-old-space-size=14366 wsrun -p @imtbl/checkout-sdk --exclude-missing -e test:coverage", "test:vpn": "RUN_VPN_TESTS=1 wsrun --exclude-missing -e test", "typecheck": "wsrun --exclude-missing typecheck" }, From 54f5e16e19854b8395781ddf6a8c8ffa8af44239 Mon Sep 17 00:00:00 2001 From: Mikhala Date: Wed, 11 Oct 2023 09:59:34 +0800 Subject: [PATCH 3/7] add to test step in yaml --- .github/workflows/build-lint-typecheck-test.yaml | 2 ++ package.json | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-lint-typecheck-test.yaml b/.github/workflows/build-lint-typecheck-test.yaml index 627bfac6f1..f1f70c5942 100644 --- a/.github/workflows/build-lint-typecheck-test.yaml +++ b/.github/workflows/build-lint-typecheck-test.yaml @@ -35,6 +35,8 @@ jobs: test: name: Test runs-on: ubuntu-latest + env: + NODE_OPTIONS: --max-old-space-size=14366 steps: - name: Checkout uses: actions/checkout@v3 diff --git a/package.json b/package.json index df879a68d1..78a3a66741 100644 --- a/package.json +++ b/package.json @@ -51,7 +51,7 @@ "syncpack:format": "yarn syncpack format", "test": "wsrun --exclude-missing -e test", "test:checkout:cypress": "wsrun -p @imtbl/checkout-widgets-lib --exclude-missing -e test:cypress", - "test:checkout:sdk:coverage": "NODE_OPTIONS=--max-old-space-size=14366 wsrun -p @imtbl/checkout-sdk --exclude-missing -e test:coverage", + "test:checkout:sdk:coverage": "wsrun -p @imtbl/checkout-sdk --exclude-missing -e test:coverage", "test:vpn": "RUN_VPN_TESTS=1 wsrun --exclude-missing -e test", "typecheck": "wsrun --exclude-missing typecheck" }, From cf029ba6aba085e44182145dbec3b96f50452c00 Mon Sep 17 00:00:00 2001 From: Mikhala Date: Wed, 11 Oct 2023 10:33:21 +0800 Subject: [PATCH 4/7] remove test --- packages/checkout/sdk/src/Checkout.ts | 3 -- .../src/widgets/ImmutableWebComponent.cy.tsx | 32 ------------------- 2 files changed, 35 deletions(-) delete mode 100644 packages/checkout/widgets-lib/src/widgets/ImmutableWebComponent.cy.tsx diff --git a/packages/checkout/sdk/src/Checkout.ts b/packages/checkout/sdk/src/Checkout.ts index 2b69da910e..e2776feb71 100644 --- a/packages/checkout/sdk/src/Checkout.ts +++ b/packages/checkout/sdk/src/Checkout.ts @@ -291,9 +291,6 @@ export class Checkout { throw new Error('This endpoint is not currently available.'); } - // eslint-disable-next-line no-console - console.log('testing ci'); - // eslint-disable-next-line no-console console.warn('This endpoint is currently under construction.'); diff --git a/packages/checkout/widgets-lib/src/widgets/ImmutableWebComponent.cy.tsx b/packages/checkout/widgets-lib/src/widgets/ImmutableWebComponent.cy.tsx deleted file mode 100644 index 235989fc12..0000000000 --- a/packages/checkout/widgets-lib/src/widgets/ImmutableWebComponent.cy.tsx +++ /dev/null @@ -1,32 +0,0 @@ -import { mount } from 'cypress/react18'; -import { createRef } from 'react'; -import { before, cy, expect } from 'local-cypress'; -import { Passport } from '@imtbl/passport'; -import { ImmutableConnect } from './connect/ConnectWebComponent'; -import { cyIntercept } from '../lib/testUtils'; - -describe('ImmutableWebComponent', () => { - before(() => { - window.customElements.define('imtbl-connect', ImmutableConnect); - }); - - beforeEach(() => { - cyIntercept(); - }); - - it('should mount the web component into the DOM and inject Passport using JS', () => { - const reference = createRef(); - const testPassportInstance = { - connectEvm: cy.stub(), - } as any as Passport; - mount( - , - ).then(() => { - (document.getElementsByTagName('imtbl-connect')[0] as ImmutableConnect)?.addPassportOption(testPassportInstance); - }).then(() => { - expect( - (document.getElementsByTagName('imtbl-connect')[0] as ImmutableConnect).passport, - ).to.eq(testPassportInstance); - }); - }); -}); From 9a791a89908fdc8e7da205d1450344377ccb237b Mon Sep 17 00:00:00 2001 From: Mikhala Date: Wed, 11 Oct 2023 11:29:31 +0800 Subject: [PATCH 5/7] force cypress 12.8.1 --- packages/checkout/widgets-lib/package.json | 2 +- yarn.lock | 51 ++++++++++------------ 2 files changed, 25 insertions(+), 28 deletions(-) diff --git a/packages/checkout/widgets-lib/package.json b/packages/checkout/widgets-lib/package.json index 0788d06ad6..01df852893 100644 --- a/packages/checkout/widgets-lib/package.json +++ b/packages/checkout/widgets-lib/package.json @@ -48,7 +48,7 @@ "@types/node": "^18.14.2", "@types/react": "^18.0.28", "@types/react-dom": "^18.0.11", - "cypress": "^12.8.1", + "cypress": "12.8.1", "eslint": "^8.40.0", "jest": "^29.4.3", "local-cypress": "^1.2.6", diff --git a/yarn.lock b/yarn.lock index 4076ef3f7a..22ed065ebb 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2187,9 +2187,9 @@ __metadata: languageName: node linkType: hard -"@cypress/request@npm:^2.88.11": - version: 2.88.11 - resolution: "@cypress/request@npm:2.88.11" +"@cypress/request@npm:^2.88.10": + version: 2.88.12 + resolution: "@cypress/request@npm:2.88.12" dependencies: aws-sign2: ~0.7.0 aws4: ^1.8.0 @@ -2206,10 +2206,10 @@ __metadata: performance-now: ^2.1.0 qs: ~6.10.3 safe-buffer: ^5.1.2 - tough-cookie: ~2.5.0 + tough-cookie: ^4.1.3 tunnel-agent: ^0.6.0 uuid: ^8.3.2 - checksum: e4b3f62e0c41c4ccca6c942828461d8ea717e752fd918d685e9f74e2ebcfa8b7942427f7ce971e502635c3bf3d40011476db84dc753d3dc360c6d08350da6f93 + checksum: 2c6fbf7f3127d41bffca8374beaa8cf95450495a8a077b00309ea9d94dd2a4da450a77fe038e8ad26c97cdd7c39b65c53c850f8338ce9bc2dbe23ce2e2b48329 languageName: node linkType: hard @@ -3163,7 +3163,7 @@ __metadata: assert: ^2.0.0 buffer: ^6.0.3 crypto-browserify: ^3.12.0 - cypress: ^12.8.1 + cypress: 12.8.1 eslint: ^8.40.0 ethers: ^5.7.2 https-browserify: ^1.0.0 @@ -13651,6 +13651,13 @@ __metadata: languageName: node linkType: hard +"commander@npm:^5.1.0": + version: 5.1.0 + resolution: "commander@npm:5.1.0" + checksum: 0b7fec1712fbcc6230fcb161d8d73b4730fa91a21dc089515489402ad78810547683f058e2a9835929c212fead1d6a6ade70db28bbb03edbc2829a9ab7d69447 + languageName: node + linkType: hard + "commander@npm:^6.2.1": version: 6.2.1 resolution: "commander@npm:6.2.1" @@ -14418,11 +14425,11 @@ __metadata: languageName: node linkType: hard -"cypress@npm:^12.8.1": - version: 12.17.1 - resolution: "cypress@npm:12.17.1" +"cypress@npm:12.8.1": + version: 12.8.1 + resolution: "cypress@npm:12.8.1" dependencies: - "@cypress/request": ^2.88.11 + "@cypress/request": ^2.88.10 "@cypress/xvfb": ^1.2.4 "@types/node": ^14.14.31 "@types/sinonjs__fake-timers": 8.1.1 @@ -14436,7 +14443,7 @@ __metadata: check-more-types: ^2.24.0 cli-cursor: ^3.1.0 cli-table3: ~0.6.1 - commander: ^6.2.1 + commander: ^5.1.0 common-tags: ^1.8.0 dayjs: ^1.10.4 debug: ^4.3.4 @@ -14454,19 +14461,19 @@ __metadata: listr2: ^3.8.3 lodash: ^4.17.21 log-symbols: ^4.0.0 - minimist: ^1.2.8 + minimist: ^1.2.6 ospath: ^1.2.2 pretty-bytes: ^5.6.0 proxy-from-env: 1.0.0 request-progress: ^3.0.0 - semver: ^7.5.3 + semver: ^7.3.2 supports-color: ^8.1.1 tmp: ~0.2.1 untildify: ^4.0.0 yauzl: ^2.10.0 bin: cypress: bin/cypress - checksum: 1f042e3e5931498bdf826cba09060939349e677fca8654c9695760acbec5a424cb69d3445ace57cf80deb496d770ffe571ef791dff72af24e7f560ee43986ee4 + checksum: a229f2b3ff20b1b533f6d4670303596aef596a394db77ea8eafe2fa8f175b79b9d48ba66262513fa806076be5c857e159539f6d8fd9acf4df9936a2fa649bf1e languageName: node linkType: hard @@ -22260,7 +22267,7 @@ __metadata: languageName: node linkType: hard -"minimist@npm:^1.2.0, minimist@npm:^1.2.5, minimist@npm:^1.2.6, minimist@npm:^1.2.8": +"minimist@npm:^1.2.0, minimist@npm:^1.2.5, minimist@npm:^1.2.6": version: 1.2.8 resolution: "minimist@npm:1.2.8" checksum: 75a6d645fb122dad29c06a7597bddea977258957ed88d7a6df59b5cd3fe4a527e253e9bbf2e783e4b73657f9098b96a5fe96ab8a113655d4109108577ecf85b0 @@ -25294,7 +25301,7 @@ __metadata: languageName: node linkType: hard -"psl@npm:^1.1.28, psl@npm:^1.1.33": +"psl@npm:^1.1.33": version: 1.9.0 resolution: "psl@npm:1.9.0" checksum: 20c4277f640c93d393130673f392618e9a8044c6c7bf61c53917a0fddb4952790f5f362c6c730a9c32b124813e173733f9895add8d26f566ed0ea0654b2e711d @@ -28773,7 +28780,7 @@ __metadata: languageName: node linkType: hard -"tough-cookie@npm:^4.0.0, tough-cookie@npm:^4.1.2": +"tough-cookie@npm:^4.0.0, tough-cookie@npm:^4.1.2, tough-cookie@npm:^4.1.3": version: 4.1.3 resolution: "tough-cookie@npm:4.1.3" dependencies: @@ -28785,16 +28792,6 @@ __metadata: languageName: node linkType: hard -"tough-cookie@npm:~2.5.0": - version: 2.5.0 - resolution: "tough-cookie@npm:2.5.0" - dependencies: - psl: ^1.1.28 - punycode: ^2.1.1 - checksum: 16a8cd090224dd176eee23837cbe7573ca0fa297d7e468ab5e1c02d49a4e9a97bb05fef11320605eac516f91d54c57838a25864e8680e27b069a5231d8264977 - languageName: node - linkType: hard - "tr46@npm:^1.0.1": version: 1.0.1 resolution: "tr46@npm:1.0.1" From 6a013586fe3e8376406d1dee7ff5201dfaf8df6a Mon Sep 17 00:00:00 2001 From: Mikhala Date: Wed, 11 Oct 2023 10:33:21 +0800 Subject: [PATCH 6/7] Revert "remove test" This reverts commit cf029ba6aba085e44182145dbec3b96f50452c00. --- packages/checkout/sdk/src/Checkout.ts | 3 ++ .../src/widgets/ImmutableWebComponent.cy.tsx | 32 +++++++++++++++++++ 2 files changed, 35 insertions(+) create mode 100644 packages/checkout/widgets-lib/src/widgets/ImmutableWebComponent.cy.tsx diff --git a/packages/checkout/sdk/src/Checkout.ts b/packages/checkout/sdk/src/Checkout.ts index e2776feb71..2b69da910e 100644 --- a/packages/checkout/sdk/src/Checkout.ts +++ b/packages/checkout/sdk/src/Checkout.ts @@ -291,6 +291,9 @@ export class Checkout { throw new Error('This endpoint is not currently available.'); } + // eslint-disable-next-line no-console + console.log('testing ci'); + // eslint-disable-next-line no-console console.warn('This endpoint is currently under construction.'); diff --git a/packages/checkout/widgets-lib/src/widgets/ImmutableWebComponent.cy.tsx b/packages/checkout/widgets-lib/src/widgets/ImmutableWebComponent.cy.tsx new file mode 100644 index 0000000000..235989fc12 --- /dev/null +++ b/packages/checkout/widgets-lib/src/widgets/ImmutableWebComponent.cy.tsx @@ -0,0 +1,32 @@ +import { mount } from 'cypress/react18'; +import { createRef } from 'react'; +import { before, cy, expect } from 'local-cypress'; +import { Passport } from '@imtbl/passport'; +import { ImmutableConnect } from './connect/ConnectWebComponent'; +import { cyIntercept } from '../lib/testUtils'; + +describe('ImmutableWebComponent', () => { + before(() => { + window.customElements.define('imtbl-connect', ImmutableConnect); + }); + + beforeEach(() => { + cyIntercept(); + }); + + it('should mount the web component into the DOM and inject Passport using JS', () => { + const reference = createRef(); + const testPassportInstance = { + connectEvm: cy.stub(), + } as any as Passport; + mount( + , + ).then(() => { + (document.getElementsByTagName('imtbl-connect')[0] as ImmutableConnect)?.addPassportOption(testPassportInstance); + }).then(() => { + expect( + (document.getElementsByTagName('imtbl-connect')[0] as ImmutableConnect).passport, + ).to.eq(testPassportInstance); + }); + }); +}); From c443cfbd11d9a9fc126d08e2492935a0e659dbf9 Mon Sep 17 00:00:00 2001 From: Mikhala Date: Wed, 11 Oct 2023 11:43:34 +0800 Subject: [PATCH 7/7] remove ci test log --- packages/checkout/sdk/src/Checkout.ts | 3 --- 1 file changed, 3 deletions(-) diff --git a/packages/checkout/sdk/src/Checkout.ts b/packages/checkout/sdk/src/Checkout.ts index 2b69da910e..e2776feb71 100644 --- a/packages/checkout/sdk/src/Checkout.ts +++ b/packages/checkout/sdk/src/Checkout.ts @@ -291,9 +291,6 @@ export class Checkout { throw new Error('This endpoint is not currently available.'); } - // eslint-disable-next-line no-console - console.log('testing ci'); - // eslint-disable-next-line no-console console.warn('This endpoint is currently under construction.');