Skip to content

Commit

Permalink
Fix tests to work in browser
Browse files Browse the repository at this point in the history
  • Loading branch information
timovv committed Dec 9, 2021
1 parent d52f4cf commit eee8f21
Show file tree
Hide file tree
Showing 11 changed files with 415 additions and 38 deletions.
6 changes: 5 additions & 1 deletion sdk/template/template/karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

// https://github.com/karma-runner/karma-chrome-launcher
process.env.CHROME_BIN = require("puppeteer").executablePath();
process.env.RECORDINGS_RELATIVE_PATH = require("@azure-tools/test-recorder-new").relativeRecordingsPath();
require("dotenv").config();
const {
jsonRecordingFilterFunction,
Expand Down Expand Up @@ -60,7 +61,10 @@ module.exports = function(config) {
"APPCONFIG_TEST_SETTING_EXPECTED_VALUE",
"AZURE_CLIENT_ID",
"AZURE_CLIENT_SECRET",
"AZURE_TENANT_ID"
"AZURE_TENANT_ID",
"TABLES_SAS_CONNECTION_STRING",
"RECORDINGS_RELATIVE_PATH",
"STORAGE_SAS_URL"
],

// test results reporter to use
Expand Down
12 changes: 6 additions & 6 deletions sdk/template/template/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,17 +39,17 @@
"extract-api": "tsc -p . && api-extractor run --local",
"format": "prettier --write --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"test/**/*.ts\" \"samples-dev/**/*.ts\" \"*.{js,json}\"",
"generate:client": "autorest --typescript ./swagger/README.md",
"integration-test:browser": "karma start --single-run",
"integration-test:node": "nyc mocha -r esm --require source-map-support/register --reporter ../../../common/tools/mocha-multi-reporter.js --timeout 5000000 --full-trace \"dist-esm/test/{,!(browser)/**/}/*.spec.js\"",
"integration-test:browser": "dev-tool run test:browser",
"integration-test:node":"dev-tool run test:node-ts-input --mocha=\"--timeout 1200000 'test/**/*.spec.ts'\"",
"integration-test": "npm run integration-test:node && npm run integration-test:browser",
"lint:fix": "eslint package.json api-extractor.json src test --ext .ts --fix --fix-type [problem,suggestion]",
"lint": "eslint package.json api-extractor.json src test --ext .ts",
"pack": "npm pack 2>&1",
"test:browser": "npm run clean && npm run build:test && npm run unit-test:browser && npm run integration-test:browser",
"test:node": "npm run clean && tsc -p . && npm run unit-test:node && npm run integration-test:node",
"test:browser": "npm run clean && npm run build:test && npm run integration-test:browser",
"test:node": "npm run clean && tsc -p . && npm run integration-test:node",
"test": "npm run clean && tsc -p . && npm run unit-test:node && rollup -c 2>&1 && npm run unit-test:browser && npm run integration-test",
"unit-test:browser": "dev-tool run test:browser",
"unit-test:node": "dev-tool run test:node-ts-input --mocha=\"--timeout 1200000 'test/**/*.spec.ts'\"",
"unit-test:browser": "npm run integration-test:browser",
"unit-test:node": "npm run integration-test:node",
"unit-test": "npm run unit-test:node && npm run unit-test:browser"
},
"files": [
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit eee8f21

Please sign in to comment.