Skip to content

Commit

Permalink
update test-browser output folder (Azure#14384)
Browse files Browse the repository at this point in the history
  • Loading branch information
KarishmaGhiya authored and vindicatesociety committed Apr 26, 2021
1 parent e46f371 commit ad3ce2c
Show file tree
Hide file tree
Showing 41 changed files with 72 additions and 75 deletions.
6 changes: 3 additions & 3 deletions sdk/appconfiguration/app-configuration/karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ module.exports = function(config) {
// polyfill service supporting IE11 missing features
// Promise,String.prototype.startsWith,String.prototype.endsWith,String.prototype.repeat,String.prototype.includes,Array.prototype.includes,Object.keys
"https://cdn.polyfill.io/v2/polyfill.js?features=Promise,String.prototype.startsWith,String.prototype.endsWith,String.prototype.repeat,String.prototype.includes,Array.prototype.includes,Object.keys|always",
"test-browser/index.js",
{ pattern: "test-browser/index.js.map", type: "html", included: false, served: true }
"dist-test/index.browser.js",
{ pattern: "dist-test/index.browser.js.map", type: "html", included: false, served: true }
],

// list of files / patterns to exclude
Expand All @@ -42,7 +42,7 @@ module.exports = function(config) {
"**/*.js": ["env"]
// IMPORTANT: COMMENT following line if you want to debug in your browsers!!
// Preprocess source file to calculate code coverage, however this will make source file unreadable
// "test-browser/index.js": ["coverage"]
// "dist-test/index.browser.js": ["coverage"]
},

// inject following environment values into browser testing with window.__env__
Expand Down
4 changes: 2 additions & 2 deletions sdk/appconfiguration/app-configuration/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,12 @@
"swagger": "autorest --typescript swagger/swagger.md",
"integration-test": "npm run integration-test:node && npm run integration-test:browser",
"integration-test:browser": "npm run build:test:browser && cross-env TEST_MODE=live karma start --single-run",
"integration-test:node": "npm run build:test:node && nyc mocha -r esm --require source-map-support/register --reporter ../../../common/tools/mocha-multi-reporter.js --timeout 180000 --full-trace dist-esm/test/*.spec.js dist-esm/test/**/*.spec.js",
"integration-test:node": "npm run build:test:node && nyc mocha -r esm --require source-map-support/register --reporter ../../../common/tools/mocha-multi-reporter.js --timeout 180000 --full-trace \"dist-esm/test/*.spec.js\" \"dist-esm/test/**/*.spec.js\"",
"test:browser": "npm run clean && npm run build:test:browser && npm run unit-test:browser",
"test:node": "npm run clean && npm run build:test:node && npm run unit-test:node",
"test": "npm run test:node && npm run test:browser",
"unit-test:browser": "",
"unit-test:node": "npm run build:test:node && mocha --require source-map-support/register --reporter ../../../common/tools/mocha-multi-reporter.js --timeout 180000 --full-trace test-dist/index.node.js",
"unit-test:node": "npm run build:test:node && mocha --require source-map-support/register --reporter ../../../common/tools/mocha-multi-reporter.js --timeout 180000 --full-trace \"dist-test/index.node.js\"",
"unit-test": "npm run unit-test:node && npm run unit-test:browser",
"docs": "typedoc --excludePrivate --excludeNotExported --excludeExternals --stripInternal --mode file --out ./dist/docs ./src"
},
Expand Down
4 changes: 2 additions & 2 deletions sdk/appconfiguration/app-configuration/rollup.base.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ export function nodeConfig(test = false) {
);

// different output file
baseConfig.output.file = "test-dist/index.node.js";
baseConfig.output.file = "dist-test/index.node.js";

// mark assert packages we use as external
baseConfig.external.push("assert");
Expand Down Expand Up @@ -163,7 +163,7 @@ export function browserConfig(test = false) {
...[shim({ path: `export function join() {}`, dotenv: `export function config() { }` })]
);

baseConfig.output.file = "test-browser/index.js";
baseConfig.output.file = "dist-test/index.browser.js";

// Disable tree-shaking of test code. In [email protected], rollup started respecting
// the "sideEffects" field in package.json. Since our package.json sets "sideEffects=false", this also
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ module.exports = function(config) {
"recordings/browsers/**/*.json": ["json"]
// IMPORTANT: COMMENT following line if you want to debug in your browsers!!
// Preprocess source file to calculate code coverage, however this will make source file unreadable
//"test-browser/index.js": ["coverage"]
//"dist-test/index.browser.js": ["coverage"]
},

// inject following environment values into browser testing with window.__env__
Expand Down
4 changes: 2 additions & 2 deletions sdk/communication/communication-administration/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"format": "prettier --write --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"",
"generate-doc": "api-documenter markdown -i temp -o docGen",
"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 --full-trace -t 300000 dist-esm/test/*.spec.js dist-esm/test/node/*.spec.js",
"integration-test:node": "nyc mocha -r esm --require source-map-support/register --reporter ../../../common/tools/mocha-multi-reporter.js --full-trace -t 300000 \"dist-esm/test/*.spec.js\" \"dist-esm/test/node/*.spec.js\"",
"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 -f html -o communication-administration-lintReport.html || exit 0",
Expand All @@ -36,7 +36,7 @@
"test:node": "npm run build:test && npm run unit-test:node && npm run integration-test:node",
"test:watch": "npm run test -- --watch --reporter min",
"unit-test:browser": "karma start --single-run",
"unit-test:node": "mocha --reporter ../../../common/tools/mocha-multi-reporter.js dist-test/index.node.js",
"unit-test:node": "mocha --reporter ../../../common/tools/mocha-multi-reporter.js \"dist-test/index.node.js\"",
"unit-test": "npm run unit-test:node && npm run unit-test:browser",
"docs": "typedoc --excludePrivate --excludeNotExported --excludeExternals --stripInternal --mode file --out ./dist/docs ./src"
},
Expand Down
2 changes: 1 addition & 1 deletion sdk/communication/communication-chat/karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ module.exports = function(config) {
"recordings/browsers/**/*.json": ["json"]
// IMPORTANT: COMMENT following line if you want to debug in your browsers!!
// Preprocess source file to calculate code coverage, however this will make source file unreadable
//"test-browser/index.js": ["coverage"]
//"dist-test/index.browser.js": ["coverage"]
},

// inject following environment values into browser testing with window.__env__
Expand Down
4 changes: 2 additions & 2 deletions sdk/communication/communication-chat/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"extract-api": "tsc -p . && api-extractor run --local",
"format": "prettier --write --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"",
"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 --full-trace -t 300000 dist-esm/test/*.spec.js dist-esm/test/node/*.spec.js",
"integration-test:node": "nyc mocha -r esm --require source-map-support/register --reporter ../../../common/tools/mocha-multi-reporter.js --full-trace -t 300000 \"dist-esm/test/*.spec.js\" \"dist-esm/test/node/*.spec.js\"",
"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 -f html -o communication-chat-lintReport.html || exit 0",
Expand All @@ -30,7 +30,7 @@
"test:node": "npm run build:test && npm run unit-test:node && npm run integration-test:node",
"test": "npm run build:test && npm run unit-test && npm run integration-test",
"unit-test:browser": "karma start --single-run",
"unit-test:node": "mocha --reporter ../../../common/tools/mocha-multi-reporter.js dist-test/index.node.js",
"unit-test:node": "mocha --reporter ../../../common/tools/mocha-multi-reporter.js \"dist-test/index.node.js\"",
"unit-test": "npm run unit-test:node && npm run unit-test:browser",
"docs": "typedoc --excludePrivate --excludeNotExported --excludeExternals --stripInternal --mode file --out ./dist/docs ./src"
},
Expand Down
4 changes: 2 additions & 2 deletions sdk/communication/communication-common/karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@ module.exports = function(config) {
// preprocess matching files before serving them to the browser
// available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
preprocessors: {
"**/*.js": ["env"],
"**/*.js": ["env"]
// IMPORTANT: COMMENT following line if you want to debug in your browsers!!
// Preprocess source file to calculate code coverage, however this will make source file unreadable
"test-browser/index.js": ["coverage"]
//"dist-test/index.browser.js": ["coverage"]
},

// inject following environment values into browser testing with window.__env__
Expand Down
2 changes: 1 addition & 1 deletion sdk/communication/communication-identity/karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ module.exports = function(config) {
"recordings/browsers/**/*.json": ["json"]
// IMPORTANT: COMMENT following line if you want to debug in your browsers!!
// Preprocess source file to calculate code coverage, however this will make source file unreadable
//"test-browser/index.js": ["coverage"]
//"dist-test/index.browser.js": ["coverage"]
},

// inject following environment values into browser testing with window.__env__
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ module.exports = function(config) {
"recordings/browsers/**/*.json": ["json"]
// IMPORTANT: COMMENT following line if you want to debug in your browsers!!
// Preprocess source file to calculate code coverage, however this will make source file unreadable
//"test-browser/index.js": ["coverage"]
//"dist-test/index.browser.js": ["coverage"]
},

// inject following environment values into browser testing with window.__env__
Expand Down
2 changes: 1 addition & 1 deletion sdk/communication/communication-sms/karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ module.exports = function(config) {
"recordings/browsers/**/*.json": ["json"]
// IMPORTANT: COMMENT following line if you want to debug in your browsers!!
// Preprocess source file to calculate code coverage, however this will make source file unreadable
// "test-browser/index.js": ["coverage"]
// "dist-test/index.browser.js": ["coverage"]
},

// inject following environment values into browser testing with window.__env__
Expand Down
4 changes: 2 additions & 2 deletions sdk/containerregistry/container-registry/karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@ module.exports = function(config) {
// available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
preprocessors: {
"**/*.js": ["env"],
"recordings/browsers/**/*.json": ["json"],
"recordings/browsers/**/*.json": ["json"]
// IMPORTANT: COMMENT following line if you want to debug in your browsers!!
// Preprocess source file to calculate code coverage, however this will make source file unreadable
"test-browser/index.js": ["coverage"]
//"dist-test/index.browser.js": ["coverage"]
},

envPreprocessor: [
Expand Down
8 changes: 4 additions & 4 deletions sdk/core/abort-controller/karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ module.exports = function(config) {

// list of files / patterns to load in the browser
files: [
"test-browser/index.js",
{ pattern: "test-browser/index.js.map", type: "html", included: false, served: true }
"dist-test/index.browser.js",
{ pattern: "dist-test/index.browser.js.map", type: "html", included: false, served: true }
],

// list of files / patterns to exclude
Expand All @@ -36,10 +36,10 @@ module.exports = function(config) {
// preprocess matching files before serving them to the browser
// available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
preprocessors: {
"**/*.js": ["sourcemap", "env"],
"**/*.js": ["sourcemap", "env"]
// IMPORTANT: COMMENT following line if you want to debug in your browsers!!
// Preprocess source file to calculate code coverage, however this will make source file unreadable
"test-browser/index.js": ["coverage"]
//"dist-test/index.browser.js": ["coverage"]
},

// test results reporter to use
Expand Down
2 changes: 1 addition & 1 deletion sdk/core/abort-controller/rollup.base.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ export function browserConfig(test = false) {
console.log("yes test");
baseConfig.input = "dist-esm/test/**/*.spec.js";
baseConfig.plugins.unshift(multiEntry({ exports: false }));
baseConfig.output.file = "test-browser/index.js";
baseConfig.output.file = "dist-test/index.browser.js";
baseConfig.context = "null";

// Disable tree-shaking of test code. In [email protected], rollup started respecting
Expand Down
4 changes: 2 additions & 2 deletions sdk/core/core-amqp/karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ module.exports = function(config) {

// list of files / patterns to load in the browser
files: [
"test-browser/index.js",
{ pattern: "test-browser/index.js.map", type: "html", included: false, served: true }
"dist-test/index.browser.js",
{ pattern: "dist-test/index.browser.js.map", type: "html", included: false, served: true }
],

// list of files / patterns to exclude
Expand Down
2 changes: 1 addition & 1 deletion sdk/core/core-amqp/rollup.base.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ export function browserConfig(test = false) {
if (test) {
baseConfig.input = ["dist-esm/test/*.spec.js", "dist-esm/test/browser/*.spec.js"];
baseConfig.plugins.unshift(multiEntry({ exports: false }));
baseConfig.output.file = "test-browser/index.js";
baseConfig.output.file = "dist-test/index.browser.js";

// Disable tree-shaking of test code. In [email protected], rollup started respecting
// the "sideEffects" field in package.json. Since our package.json sets "sideEffects=false", this also
Expand Down
2 changes: 1 addition & 1 deletion sdk/core/core-auth/rollup.base.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ export function browserConfig(test = false) {
if (test) {
baseConfig.input = "dist-esm/test/**/*.spec.js";
baseConfig.plugins.unshift(multiEntry({ exports: false }));
baseConfig.output.file = "test-browser/index.js";
baseConfig.output.file = "dist-test/index.browser.js";

// Disable tree-shaking of test code. In [email protected], rollup started respecting
// the "sideEffects" field in package.json. Since our package.json sets "sideEffects=false", this also
Expand Down
4 changes: 2 additions & 2 deletions sdk/core/core-client/karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@ module.exports = function(config) {
// preprocess matching files before serving them to the browser
// available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
preprocessors: {
"**/*.js": ["sourcemap", "env"],
"**/*.js": ["sourcemap", "env"]
// IMPORTANT: COMMENT following line if you want to debug in your browsers!!
// Preprocess source file to calculate code coverage, however this will make source file unreadable
"test-browser/index.js": ["coverage"]
//"dist-test/index.browser.js": ["coverage"]
},

// inject following environment values into browser testing with window.__env__
Expand Down
8 changes: 3 additions & 5 deletions sdk/core/core-http/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,11 @@
},
"scripts": {
"audit": "node ../../../common/scripts/rush-audit.js && rimraf node_modules package-lock.json && npm i --package-lock-only 2>&1 && npm audit",
"build": "run-s build:tsc extract-api:nobuild build:types build:rollup",
"build": "tsc -p tsconfig.es.json && npm run build:nodebrowser && npm run extract-api:nobuild && npm run build:types",
"build:scripts": "tsc -p ./.scripts/",
"build:test": "run-s build build:test-browser",
"build:tsc": "tsc -p tsconfig.es.json",
"build:test": "tsc -p tsconfig.es.json && rollup -c rollup.test.config.js 2>&1",
"build:types": "downlevel-dts types/latest/ types/3.1/",
"build:rollup": "rollup -c 2>&1",
"build:test-browser": "rollup -c rollup.test.config.js 2>&1",
"build:nodebrowser": "rollup -c 2>&1",
"check-format": "prettier --list-different --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"",
"clean": "rimraf ./es ./dist ./dist-test ./dist-browser ./types ./types3.1 ./coverage ./temp ./*.tgz",
"execute:samples": "echo skipped",
Expand Down
4 changes: 2 additions & 2 deletions sdk/core/core-lro/karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ module.exports = function(config) {
exclude: [],

preprocessors: {
"**/*.js": ["sourcemap", "env"],
"dist-test/index.browser.js": ["coverage"]
"**/*.js": ["sourcemap", "env"]
//"dist-test/index.browser.js": ["coverage"]
},

reporters: ["mocha", "coverage", "junit"],
Expand Down
2 changes: 1 addition & 1 deletion sdk/core/core-tracing/rollup.base.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ export function browserConfig(test = false) {
if (test) {
baseConfig.input = "dist-esm/test/**/*.spec.js";
baseConfig.plugins.unshift(multiEntry({ exports: false }));
baseConfig.output.file = "test-browser/index.js";
baseConfig.output.file = "dist-test/index.browser.js";

// Disable tree-shaking of test code. In [email protected], rollup started respecting
// the "sideEffects" field in package.json. Since our package.json sets "sideEffects=false", this also
Expand Down
4 changes: 2 additions & 2 deletions sdk/core/core-util/karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@ module.exports = function(config) {
// preprocess matching files before serving them to the browser
// available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
preprocessors: {
"**/*.js": ["sourcemap", "env"],
"**/*.js": ["sourcemap", "env"]
// IMPORTANT: COMMENT following line if you want to debug in your browsers!!
// Preprocess source file to calculate code coverage, however this will make source file unreadable
"test-browser/index.js": ["coverage"]
//"dist-test/index.browser.js": ["coverage"]
},

// inject following environment values into browser testing with window.__env__
Expand Down
4 changes: 2 additions & 2 deletions sdk/core/core-xml/karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@ module.exports = function(config) {
// preprocess matching files before serving them to the browser
// available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
preprocessors: {
"**/*.js": ["sourcemap", "env"],
"**/*.js": ["sourcemap", "env"]
// IMPORTANT: COMMENT following line if you want to debug in your browsers!!
// Preprocess source file to calculate code coverage, however this will make source file unreadable
"test-browser/index.js": ["coverage"]
//"dist-test/index.browser.js": ["coverage"]
},

// inject following environment values into browser testing with window.__env__
Expand Down
6 changes: 3 additions & 3 deletions sdk/core/logger/karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ module.exports = function(config) {

// list of files / patterns to load in the browser
files: [
"test-browser/index.js",
{ pattern: "test-browser/index.js.map", type: "html", included: false, served: true }
"dist-test/index.browser.js",
{ pattern: "dist-test/index.browser.js.map", type: "html", included: false, served: true }
],

// list of files / patterns to exclude
Expand All @@ -42,7 +42,7 @@ module.exports = function(config) {
"**/*.js": ["env"]
// IMPORTANT: COMMENT following line if you want to debug in your browsers!!
// Preprocess source file to calculate code coverage, however this will make source file unreadable
// "test-browser/index.js": ["coverage"]
// "dist-test/index.browser.js": ["coverage"]
},

// test results reporter to use
Expand Down
2 changes: 1 addition & 1 deletion sdk/core/logger/rollup.base.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ export function browserConfig(test = false) {
// Entry points - test files under the `test` folder(common for both browser and node), browser specific test files
baseConfig.input = ["dist-esm/test/*.spec.js", "dist-esm/test/browser/*.spec.js"];
baseConfig.plugins.unshift(multiEntry({ exports: false }));
baseConfig.output.file = "test-browser/index.js";
baseConfig.output.file = "dist-test/index.browser.js";
baseConfig.context = "null";

baseConfig.onwarn = (warning) => {
Expand Down
Loading

0 comments on commit ad3ce2c

Please sign in to comment.