diff --git a/.github/workflows/node-test.yml b/.github/workflows/node-test.yml index b58c4c6e81d..8087b37b155 100644 --- a/.github/workflows/node-test.yml +++ b/.github/workflows/node-test.yml @@ -38,6 +38,35 @@ jobs: - run: npm i -g npm@9.5 - run: npm ci - run: npm run lint:changed-files + - run: npm run lint + working-directory: firebase-vscode + + vscode_unit: + # Using windows to bypass an error thrown by VScode + # when run in an environment that does not have a screen. + runs-on: windows-latest + strategy: + matrix: + node-version: + - "18" + - "20" + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node-version }} + cache: npm + cache-dependency-path: firebase-vscode/package-lock.json + + - run: npm i -g npm@9.5 + - run: npm ci + - run: npm install + working-directory: firebase-vscode + - run: npm run test:unit + working-directory: firebase-vscode + + - uses: codecov/codecov-action@v3 + if: matrix.node-version == '20' unit: runs-on: ubuntu-latest diff --git a/firebase-vscode/package.json b/firebase-vscode/package.json index 8d1bb94cda0..901a344f819 100644 --- a/firebase-vscode/package.json +++ b/firebase-vscode/package.json @@ -194,7 +194,7 @@ "test-compile": "npm run copyfiles && webpack --config src/test/webpack.test.js", "lint": "eslint src --ext ts", "test": "npm run test:unit && npm run test:e2e", - "pretest:unit": "npm run test-compile && npm run lint && tsc -p src/test/tsconfig.test.json", + "pretest:unit": "npm run test-compile && npm run build && tsc -p src/test/tsconfig.test.json", "test:unit": "node ./dist/test/firebase-vscode/src/test/runTest.js", "test:e2e": "npm run test:e2e:empty && npm run test:e2e:fishfood", "test:e2e:empty": "TS_NODE_PROJECT=\"./src/test/tsconfig.test.json\" TEST=true wdio run ./src/test/empty_wdio.conf.ts", diff --git a/firebase-vscode/src/stubs/inquirer-stub.js b/firebase-vscode/src/stubs/inquirer-stub.js index ede76f517d8..e173ae49eac 100644 --- a/firebase-vscode/src/stubs/inquirer-stub.js +++ b/firebase-vscode/src/stubs/inquirer-stub.js @@ -22,7 +22,7 @@ inquirer.prompt = async (prompts) => { } else { pluginLogger.debug( `Didn't find "${prompt.name}" in options (message:` + - ` "${prompt.message}"), defaulting to value "${prompt.default}"` + ` "${prompt.message}"), defaulting to value "${prompt.default}"`, ); answers[prompt.name] = prompt.default; } diff --git a/firebase-vscode/src/test/runTest.ts b/firebase-vscode/src/test/runTest.ts index 0dc9633413d..6e533da0d23 100644 --- a/firebase-vscode/src/test/runTest.ts +++ b/firebase-vscode/src/test/runTest.ts @@ -10,7 +10,7 @@ async function main() { // The path to test runner // Passed to --extensionTestsPath - const extensionTestsPath = path.resolve(__dirname, "./suite/index"); + const extensionTestsPath = path.resolve(__dirname, "./suite/src/core/index"); // Download VS Code, unzip it and run the integration test await runTests({ diff --git a/firebase-vscode/webpack.common.js b/firebase-vscode/webpack.common.js index b251eafde0c..746e579be45 100644 --- a/firebase-vscode/webpack.common.js +++ b/firebase-vscode/webpack.common.js @@ -82,7 +82,7 @@ const extensionConfig = { inquirer: path.resolve(__dirname, "src/stubs/inquirer-stub.js"), "inquirer-autocomplete-prompt": path.resolve( __dirname, - "src/stubs/inquirer-stub.js" + "src/stubs/inquirer-stub.js", ), // This is used for Github deploy to hosting - will need to restore // or find another solution if we add that feature.