diff --git a/.evergreen.yml b/.evergreen.yml index 6a97e51..8407424 100644 --- a/.evergreen.yml +++ b/.evergreen.yml @@ -14,7 +14,7 @@ functions: set -e set -x - export NODE_VERSION=16.19.0 + export NODE_VERSION=22.15.1 bash .evergreen/install-node.sh install: - command: shell.exec diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml index ed6d790..698c6a3 100644 --- a/.github/workflows/nodejs.yml +++ b/.github/workflows/nodejs.yml @@ -11,12 +11,12 @@ name: CI jobs: test: name: Test - timeout-minutes: 10 + timeout-minutes: 20 strategy: fail-fast: false matrix: os: [ubuntu-latest, macos-latest, windows-latest] - node-version: [16.x, 18.x, 20.x] + node-version: [20.x, 22.x, 24.x] runs-on: ${{matrix.os}} steps: - uses: actions/checkout@v4 @@ -24,7 +24,7 @@ jobs: uses: actions/setup-node@v4 with: node-version: ${{ matrix.node-version }} - # the oidc-provider package we use doesn't list Node.js 20 as supported + # the oidc-provider package we use doesn't list Node.js 20, 22 and 24 as supported - name: Install Dependencies run: npm ci --ignore-engines - name: Test @@ -35,7 +35,7 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest] - node-version: [18.x] + node-version: [22.x] runs-on: ${{matrix.os}} steps: - uses: actions/checkout@v4 @@ -57,10 +57,10 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Use Node.js 20.x + - name: Use Node.js 22.x uses: actions/setup-node@v4 with: - node-version: 20.x + node-version: 22.x - name: Install Dependencies run: npm ci --ignore-engines diff --git a/.github/workflows/publish-release.yml b/.github/workflows/publish-release.yml index 604d452..547516f 100644 --- a/.github/workflows/publish-release.yml +++ b/.github/workflows/publish-release.yml @@ -19,10 +19,10 @@ jobs: - uses: actions/checkout@v4 - - name: Use Node.js 20.x + - name: Use Node.js 22.x uses: actions/setup-node@v4 with: - node-version: 20.x + node-version: 22.x registry-url: 'https://registry.npmjs.org' - name: Install Dependencies diff --git a/.tool-versions b/.tool-versions new file mode 100644 index 0000000..4baf1f2 --- /dev/null +++ b/.tool-versions @@ -0,0 +1,6 @@ +# This file is for the version management tool "asdf". +# mms uses it as well. + +# This Node.js version matches the one required in +# the "engines" in the package.json and .everygreen.yml +nodejs 22.15.1 diff --git a/package-lock.json b/package-lock.json index 8f4a7bf..bb6daa6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -49,7 +49,7 @@ "xvfb-maybe": "^0.2.1" }, "engines": { - "node": ">= 16.20.1" + "node": ">= 20.19.2" } }, "node_modules/@ampproject/remapping": { diff --git a/package.json b/package.json index e099743..a5b0ef8 100644 --- a/package.json +++ b/package.json @@ -30,7 +30,7 @@ "import": "./dist/.esm-wrapper.mjs" }, "engines": { - "node": ">= 16.20.1" + "node": ">= 20.19.2" }, "types": "./index.d.ts", "scripts": { diff --git a/src/plugin.spec.ts b/src/plugin.spec.ts index a35b260..4aafce9 100644 --- a/src/plugin.spec.ts +++ b/src/plugin.spec.ts @@ -680,7 +680,7 @@ describe('OIDC plugin (local OIDC provider)', function () { }); }); - it('respect user aborts and does not attempt device flow auth', async function () { + it.only('falls back to device auth flow', async function () { const events: [string, unknown][] = []; for (const event of [ 'mongodb-oidc-plugin:auth-attempt-started', @@ -689,6 +689,11 @@ describe('OIDC plugin (local OIDC provider)', function () { ]) { logger.on(event, (data) => events.push([event, data])); } + const originalEmit = logger.emit.bind(logger); + logger.emit = function (event, ...args) { + console.dir({ event, args }, { depth: 5, colors: true }); + return originalEmit(event, ...args); + }; await requestToken(plugin, provider.getMongodbOIDCDBInfo()); expect(events).to.deep.include([ 'mongodb-oidc-plugin:auth-attempt-started', diff --git a/test/oidc-test-provider.ts b/test/oidc-test-provider.ts index e421d94..0d30df7 100644 --- a/test/oidc-test-provider.ts +++ b/test/oidc-test-provider.ts @@ -285,7 +285,10 @@ async function waitForTitle( selector = 'h1' ): Promise { await browser.waitUntil(async () => { - const actual = (await browser.$(selector).getText()).trim(); + const element = await browser.$(selector); + await element.waitForDisplayed(); + const actual = (await element.getText()).trim(); + console.log({ actual, expected, selector }); let matches: boolean; if (typeof expected === 'string') { matches = actual.toLowerCase() === expected.toLowerCase();