* Update to TypeScript 4.x #1071 - Enable ESLint-Fix during compilation - Fold react and React Native projects back into main build * Update new PerfMarkMeasure to TypeScript 4.x build * Missed updates from previous PR -- remove unused variables
This commit is contained in:
Родитель
9b10d6003f
Коммит
f3f1a806c5
|
@ -0,0 +1,36 @@
|
|||
{
|
||||
"env": {
|
||||
"browser": true,
|
||||
"es2021": true
|
||||
},
|
||||
"plugins": [
|
||||
"security"
|
||||
],
|
||||
"extends": [
|
||||
"eslint:recommended",
|
||||
"plugin:@typescript-eslint/recommended",
|
||||
"plugin:security/recommended"
|
||||
],
|
||||
"rules": {
|
||||
"quotes": ["off", "double"], // Re-enable for auto fixing
|
||||
"prefer-const": "off",
|
||||
"prefer-spread": "off",
|
||||
"no-var": "off",
|
||||
"no-extra-boolean-cast": "off",
|
||||
"prefer-rest-params": "off",
|
||||
"no-case-declarations": "off",
|
||||
"no-prototype-builtins": "off",
|
||||
"no-useless-escape": "off", // Suppressing Error -- need to Review Later
|
||||
"security/detect-object-injection": "off", // Suppress Warning -- need to Review Later
|
||||
"@typescript-eslint/ban-types": "off",
|
||||
"@typescript-eslint/no-unused-vars": "off", // Re-enable for auto fixing
|
||||
"@typescript-eslint/triple-slash-reference": "off",
|
||||
"@typescript-eslint/no-inferrable-types": "off",
|
||||
"@typescript-eslint/no-this-alias": "off",
|
||||
"@typescript-eslint/no-explicit-any": "off",
|
||||
"@typescript-eslint/no-empty-function": "off",
|
||||
"@typescript-eslint/no-empty-interface": "off",
|
||||
"@typescript-eslint/explicit-module-boundary-types": "off",
|
||||
"@typescript-eslint/no-extra-semi": "off" // Re-enable for auto fixing
|
||||
}
|
||||
}
|
|
@ -16,7 +16,7 @@ jobs:
|
|||
|
||||
strategy:
|
||||
matrix:
|
||||
node-version: [10.x]
|
||||
node-version: [10.x, 12.x, 14.x, 16.x]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
@ -24,7 +24,11 @@ jobs:
|
|||
uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: ${{ matrix.node-version }}
|
||||
- run: npm install rollup -g
|
||||
- run: npm install grunt-cli findup-sync nopt pify@2.3.0
|
||||
- run: npm install
|
||||
- run: node common/scripts/install-run-rush.js check
|
||||
- run: node common/scripts/install-run-rush.js install
|
||||
- run: npm run build --verbose
|
||||
timeout-minutes: 10
|
||||
- run: npm run test --verbose
|
||||
|
|
|
@ -28,6 +28,6 @@ jobs:
|
|||
uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: ${{ matrix.node-version }}
|
||||
- run: npm install
|
||||
- run: npm run build --if-present
|
||||
- run: npm test
|
||||
# - run: npm install
|
||||
# - run: npm run build --if-present
|
||||
# - run: npm test
|
||||
|
|
|
@ -24,14 +24,14 @@ jobs:
|
|||
uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: ${{ matrix.node-version }}
|
||||
- name: Install root dependencies
|
||||
run: npm install
|
||||
- name: Install ReactNative plugin dependencies
|
||||
working-directory: extensions/applicationinsights-react-native
|
||||
run: npm install
|
||||
- name: Build ReactNative plugin
|
||||
working-directory: extensions/applicationinsights-react-native
|
||||
run: npm run build --if-present
|
||||
- name: Run tests for ReactNative plugin
|
||||
working-directory: extensions/applicationinsights-react-native
|
||||
run: npm test
|
||||
# - name: Install root dependencies
|
||||
# run: npm install
|
||||
# - name: Install ReactNative plugin dependencies
|
||||
# working-directory: extensions/applicationinsights-react-native
|
||||
# run: npm install
|
||||
# - name: Build ReactNative plugin
|
||||
# working-directory: extensions/applicationinsights-react-native
|
||||
# run: npm run build --if-present
|
||||
# - name: Run tests for ReactNative plugin
|
||||
# working-directory: extensions/applicationinsights-react-native
|
||||
# run: npm test
|
||||
|
|
|
@ -910,8 +910,8 @@ export class ApplicationInsightsTests extends TestClass {
|
|||
}
|
||||
|
||||
class CustomTestError extends Error {
|
||||
constructor(message = "", ...args) {
|
||||
super(message, ...args);
|
||||
constructor(message = "") {
|
||||
super(message);
|
||||
this.name = "CustomTestError";
|
||||
this.message = message + " -- test error.";
|
||||
}
|
||||
|
|
|
@ -38,13 +38,13 @@
|
|||
"@microsoft/applicationinsights-rollup-es3": "1.1.3",
|
||||
"sinon": "^7.3.1",
|
||||
"chromedriver": "^2.45.0",
|
||||
"@microsoft/api-extractor": "^7.9.11",
|
||||
"@microsoft/api-extractor": "^7.18.1",
|
||||
"finalhandler": "^1.1.1",
|
||||
"grunt": "^1.4.1",
|
||||
"grunt-cli": "^1.4.3",
|
||||
"grunt-contrib-qunit": "^5.0.1",
|
||||
"@nevware21/grunt-ts-plugin": "^0.4.3",
|
||||
"grunt-tslint": "^5.0.2",
|
||||
"@nevware21/grunt-eslint-ts": "^0.2.1",
|
||||
"globby": "^11.0.0",
|
||||
"magic-string": "^0.25.7",
|
||||
"pako": "^2.0.3",
|
||||
|
@ -56,10 +56,11 @@
|
|||
"selenium-server-standalone-jar": "^3.141.5",
|
||||
"serve-static": "^1.13.2",
|
||||
"source-map-loader": "^0.2.3",
|
||||
"tslint": "^5.19.0",
|
||||
"tslint-config-prettier": "^1.18.0",
|
||||
"typescript": "2.5.3",
|
||||
"tslib": "^1.13.0"
|
||||
"typescript": "^4.3.4",
|
||||
"tslib": "^2.0.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"tslib": "*"
|
||||
},
|
||||
"dependencies": {
|
||||
"@microsoft/dynamicproto-js": "^1.1.4",
|
||||
|
|
|
@ -371,10 +371,10 @@ export class Initialization implements IApplicationInsights {
|
|||
|
||||
// apply updated properties to the global instance (snippet)
|
||||
objForEachKey(_self, (field, value) => {
|
||||
if (isString(field) &&
|
||||
!isFunction(value) &&
|
||||
if (isString(field) &&
|
||||
!isFunction(value) &&
|
||||
field && field[0] !== "_" && // Don't copy "internal" values
|
||||
_ignoreUpdateSnippetProperties.indexOf(field) === -1) {
|
||||
_ignoreUpdateSnippetProperties.indexOf(field) === -1) {
|
||||
snippet[field as string] = value;
|
||||
}
|
||||
});
|
||||
|
|
|
@ -21,12 +21,13 @@
|
|||
"devDependencies": {
|
||||
"@microsoft/applicationinsights-rollup-plugin-uglify3-js": "1.0.0",
|
||||
"@microsoft/applicationinsights-rollup-es3": "1.1.3",
|
||||
"@microsoft/api-extractor": "^7.9.11",
|
||||
"@microsoft/api-extractor": "^7.18.1",
|
||||
"grunt": "^1.4.1",
|
||||
"grunt-cli": "^1.4.3",
|
||||
"grunt-contrib-qunit": "^5.0.1",
|
||||
"grunt-run": "^0.8.1",
|
||||
"@nevware21/grunt-ts-plugin": "^0.4.3",
|
||||
"@nevware21/grunt-eslint-ts": "^0.2.1",
|
||||
"globby": "^11.0.0",
|
||||
"magic-string": "^0.25.7",
|
||||
"@rollup/plugin-commonjs": "^18.0.0",
|
||||
|
@ -35,10 +36,11 @@
|
|||
"rollup-plugin-cleanup": "3.2.1",
|
||||
"rollup": "^2.32.0",
|
||||
"source-map-loader": "^0.2.3",
|
||||
"typescript": "2.5.3",
|
||||
"tslib": "^1.13.0",
|
||||
"tslint": "^5.19.0",
|
||||
"tslint-config-prettier": "^1.18.0"
|
||||
"typescript": "^4.3.4",
|
||||
"tslib": "^2.0.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"tslib": "*"
|
||||
},
|
||||
"dependencies": {
|
||||
"@microsoft/dynamicproto-js": "^1.1.4",
|
||||
|
@ -47,6 +49,5 @@
|
|||
"@microsoft/applicationinsights-channel-js": "2.6.5",
|
||||
"@microsoft/applicationinsights-core-js": "2.6.5"
|
||||
},
|
||||
"peerDependencies": {},
|
||||
"license": "MIT"
|
||||
}
|
||||
|
|
|
@ -24,13 +24,13 @@
|
|||
"@microsoft/ai-test-framework": "0.0.1",
|
||||
"@microsoft/applicationinsights-rollup-plugin-uglify3-js": "1.0.0",
|
||||
"@microsoft/applicationinsights-rollup-es3": "1.1.3",
|
||||
"@microsoft/api-extractor": "^7.9.11",
|
||||
"@microsoft/api-extractor": "^7.18.1",
|
||||
"@types/sinon": "4.3.3",
|
||||
"grunt": "^1.4.1",
|
||||
"grunt-cli": "^1.4.3",
|
||||
"grunt-contrib-qunit": "^5.0.1",
|
||||
"grunt-run": "^0.8.1",
|
||||
"@nevware21/grunt-ts-plugin": "^0.4.3",
|
||||
"@nevware21/grunt-eslint-ts": "^0.2.1",
|
||||
"globby": "^11.0.0",
|
||||
"magic-string": "^0.25.7",
|
||||
"@rollup/plugin-commonjs": "^18.0.0",
|
||||
|
@ -38,12 +38,13 @@
|
|||
"@rollup/plugin-replace": "^2.3.3",
|
||||
"rollup-plugin-cleanup": "3.2.1",
|
||||
"rollup": "^2.32.0",
|
||||
"typescript": "2.5.3",
|
||||
"tslib": "^1.13.0",
|
||||
"tslint": "^5.19.0",
|
||||
"tslint-config-prettier": "^1.18.0",
|
||||
"typescript": "^4.3.4",
|
||||
"tslib": "^2.0.0",
|
||||
"sinon": "^7.3.1"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"tslib": "*"
|
||||
},
|
||||
"dependencies": {
|
||||
"@microsoft/dynamicproto-js": "^1.1.4",
|
||||
"@microsoft/applicationinsights-shims": "2.0.0",
|
||||
|
|
|
@ -814,7 +814,7 @@ export class Sender extends BaseTelemetryPlugin implements IChannelControlsAI {
|
|||
const xdr = new XDomainRequest();
|
||||
xdr.onload = () => _self._xdrOnLoad(xdr, payload);
|
||||
xdr.onerror = (event: ErrorEvent|any) => _self._onError(payload, _formatErrorMessageXdr(xdr), event);
|
||||
|
||||
|
||||
// XDomainRequest requires the same protocol as the hosting page.
|
||||
// If the protocol doesn't match, we can't send the telemetry :(.
|
||||
const hostingProtocol = _window && _window.location && _window.location.protocol || "";
|
||||
|
|
|
@ -34,19 +34,20 @@
|
|||
"grunt": "^1.4.1",
|
||||
"grunt-contrib-qunit": "^5.0.1",
|
||||
"@nevware21/grunt-ts-plugin": "^0.4.3",
|
||||
"tslint": "^5.19.0",
|
||||
"tslint-config-prettier": "^1.18.0",
|
||||
"tslint-microsoft-contrib": "^5.2.1",
|
||||
"@rollup/plugin-commonjs": "^18.0.0",
|
||||
"@rollup/plugin-node-resolve": "^11.2.1",
|
||||
"@rollup/plugin-replace": "^2.3.3",
|
||||
"rollup": "^2.32.0",
|
||||
"typescript": "2.5.3",
|
||||
"tslib": "^1.13.0",
|
||||
"typescript": "^4.3.4",
|
||||
"tslib": "^2.0.0",
|
||||
"qunit": "^2.11.2",
|
||||
"sinon": "^7.3.1",
|
||||
"globby": "^11.0.0",
|
||||
"magic-string": "^0.25.7"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"tslib": "*"
|
||||
},
|
||||
"dependencies": {
|
||||
"@microsoft/dynamicproto-js": "^1.1.4"
|
||||
}
|
||||
|
|
|
@ -788,6 +788,7 @@ export class AITestClass {
|
|||
try {
|
||||
this._removeFuncHooks(target[name]);
|
||||
} catch (e) {
|
||||
// eslint-disable-next-line no-empty
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -1639,8 +1639,8 @@ class ChannelPlugin implements IPlugin {
|
|||
}
|
||||
|
||||
class CustomTestError extends Error {
|
||||
constructor(message = "", ...args) {
|
||||
super(message, ...args);
|
||||
constructor(message = "") {
|
||||
super(message);
|
||||
this.name = "CustomTestError";
|
||||
this.message = message + " -- test error.";
|
||||
}
|
||||
|
|
|
@ -28,9 +28,9 @@
|
|||
"@microsoft/applicationinsights-rollup-es3": "1.1.3",
|
||||
"@microsoft/applicationinsights-properties-js": "2.6.5",
|
||||
"@microsoft/applicationinsights-channel-js": "2.6.5",
|
||||
"@microsoft/api-extractor": "^7.9.11",
|
||||
"typescript": "2.5.3",
|
||||
"tslib": "^1.13.0",
|
||||
"@microsoft/api-extractor" : "^7.18.1",
|
||||
"typescript": "^4.3.4",
|
||||
"tslib": "^2.0.0",
|
||||
"globby": "^11.0.0",
|
||||
"magic-string": "^0.25.7",
|
||||
"pako": "^2.0.3",
|
||||
|
@ -44,11 +44,13 @@
|
|||
"grunt-contrib-qunit": "^5.0.1",
|
||||
"grunt-run": "^0.8.1",
|
||||
"@nevware21/grunt-ts-plugin": "^0.4.3",
|
||||
"tslint": "^5.19.0",
|
||||
"tslint-config-prettier": "^1.18.0",
|
||||
"@nevware21/grunt-eslint-ts": "^0.2.1",
|
||||
"qunit": "^2.11.2",
|
||||
"sinon": "^7.3.1"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"tslib": "*"
|
||||
},
|
||||
"dependencies": {
|
||||
"@microsoft/dynamicproto-js": "^1.1.4",
|
||||
"@microsoft/applicationinsights-shims": "2.0.0",
|
||||
|
|
|
@ -22,9 +22,9 @@
|
|||
"@microsoft/ai-test-framework": "0.0.1",
|
||||
"@microsoft/applicationinsights-rollup-plugin-uglify3-js": "1.0.0",
|
||||
"@microsoft/applicationinsights-rollup-es3": "1.1.3",
|
||||
"@microsoft/api-extractor": "^7.9.11",
|
||||
"typescript": "2.5.3",
|
||||
"tslib": "^1.13.0",
|
||||
"@microsoft/api-extractor": "^7.18.1",
|
||||
"typescript": "^4.3.4",
|
||||
"tslib": "^2.0.0",
|
||||
"globby": "^11.0.0",
|
||||
"magic-string": "^0.25.7",
|
||||
"@rollup/plugin-commonjs": "^18.0.0",
|
||||
|
@ -37,8 +37,10 @@
|
|||
"grunt-contrib-qunit": "^5.0.1",
|
||||
"grunt-run": "^0.8.1",
|
||||
"@nevware21/grunt-ts-plugin": "^0.4.3",
|
||||
"tslint": "^5.19.0",
|
||||
"tslint-config-prettier": "^1.18.0"
|
||||
"@nevware21/grunt-eslint-ts": "^0.2.1"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"tslib": "*"
|
||||
},
|
||||
"dependencies": {
|
||||
"@microsoft/dynamicproto-js": "^1.1.4",
|
||||
|
|
|
@ -25,23 +25,25 @@
|
|||
"devDependencies": {
|
||||
"@microsoft/applicationinsights-rollup-plugin-uglify3-js": "1.0.0",
|
||||
"@microsoft/applicationinsights-rollup-es3": "1.1.3",
|
||||
"@microsoft/api-extractor": "^7.9.11",
|
||||
"typescript": "2.5.3",
|
||||
"tslib": "^1.13.0",
|
||||
"@microsoft/api-extractor": "^7.18.1",
|
||||
"typescript": "^4.3.4",
|
||||
"tslib": "^2.0.0",
|
||||
"grunt": "^1.4.1",
|
||||
"grunt-cli": "^1.4.3",
|
||||
"grunt-contrib-qunit": "^5.0.1",
|
||||
"grunt-run": "^0.8.1",
|
||||
"@nevware21/grunt-ts-plugin": "^0.4.3",
|
||||
"@nevware21/grunt-eslint-ts": "^0.2.1",
|
||||
"globby": "^11.0.0",
|
||||
"magic-string": "^0.25.7",
|
||||
"@rollup/plugin-commonjs": "^18.0.0",
|
||||
"@rollup/plugin-node-resolve": "^11.2.1",
|
||||
"@rollup/plugin-replace": "^2.3.3",
|
||||
"rollup-plugin-cleanup": "3.2.1",
|
||||
"rollup": "^2.32.0",
|
||||
"tslint": "^5.19.0",
|
||||
"tslint-config-prettier": "^1.18.0"
|
||||
"rollup": "^2.32.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"tslib": "*"
|
||||
},
|
||||
"dependencies": {
|
||||
"@microsoft/dynamicproto-js": "^1.1.4",
|
||||
|
|
|
@ -13,6 +13,7 @@ export const MAX_DEPTH = 16;
|
|||
export function makeRegex(value: string) {
|
||||
if (value && value.length > 0) {
|
||||
value = value.replace(/\\/g, '\\\\');
|
||||
// eslint-disable-next-line security/detect-non-literal-regexp
|
||||
value = value.replace(/([\+\?\|\{\[\(\)\^\$\#\.]}])/g, '\\$1');
|
||||
value = value.replace(/\*/g, '.*');
|
||||
return new RegExp('(' + value + ')');
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
import { Assert, AITestClass, PollingAssert } from "@microsoft/ai-test-framework";
|
||||
import { SinonStub } from "sinon";
|
||||
import { Assert, AITestClass, PollingAssert } from "@microsoft/ai-test-framework";
|
||||
import { AjaxMonitor } from "../../../src/ajax";
|
||||
import { DisabledPropertyName, IConfig, DistributedTracingModes, RequestHeaders, IDependencyTelemetry, IRequestContext } from "@microsoft/applicationinsights-common";
|
||||
import {
|
||||
AppInsightsCore, IConfiguration, ITelemetryItem, ITelemetryPlugin, IChannelControls, _InternalMessageId,
|
||||
getPerformance, getGlobalInst, getGlobal
|
||||
} from "@microsoft/applicationinsights-core-js";
|
||||
import { SinonStub } from "sinon";
|
||||
|
||||
interface IFetchArgs {
|
||||
input: RequestInfo,
|
||||
|
|
|
@ -26,14 +26,15 @@
|
|||
"@microsoft/ai-test-framework": "0.0.1",
|
||||
"@microsoft/applicationinsights-rollup-plugin-uglify3-js": "1.0.0",
|
||||
"@microsoft/applicationinsights-rollup-es3": "1.1.3",
|
||||
"@microsoft/api-extractor": "^7.9.11",
|
||||
"typescript": "2.5.3",
|
||||
"tslib": "^1.13.0",
|
||||
"@microsoft/api-extractor": "^7.18.1",
|
||||
"typescript": "^4.3.4",
|
||||
"tslib": "^2.0.0",
|
||||
"grunt": "^1.4.1",
|
||||
"grunt-cli": "^1.4.3",
|
||||
"grunt-contrib-qunit": "^5.0.1",
|
||||
"grunt-run": "^0.8.1",
|
||||
"@nevware21/grunt-ts-plugin": "^0.4.3",
|
||||
"@nevware21/grunt-eslint-ts": "^0.2.1",
|
||||
"globby": "^11.0.0",
|
||||
"magic-string": "^0.25.7",
|
||||
"@rollup/plugin-commonjs": "^18.0.0",
|
||||
|
@ -41,11 +42,12 @@
|
|||
"@rollup/plugin-replace": "^2.3.3",
|
||||
"rollup-plugin-cleanup": "3.2.1",
|
||||
"rollup": "^2.32.0",
|
||||
"tslint": "^5.19.0",
|
||||
"tslint-config-prettier": "^1.18.0",
|
||||
"qunit": "^2.11.2",
|
||||
"sinon": "^7.3.1"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"tslib": "*"
|
||||
},
|
||||
"dependencies": {
|
||||
"@microsoft/dynamicproto-js": "^1.1.4",
|
||||
"@microsoft/applicationinsights-shims": "2.0.0",
|
||||
|
|
|
@ -50,7 +50,7 @@ function _supportsAjaxMonitoring(ajaxMonitorInstance:AjaxMonitor): boolean {
|
|||
if (typeof XMLHttpRequest !== strUndefined && !isNullOrUndefined(XMLHttpRequest)) {
|
||||
let proto = XMLHttpRequest[strPrototype];
|
||||
result = !isNullOrUndefined(proto) &&
|
||||
!isNullOrUndefined(proto.open) &&
|
||||
!isNullOrUndefined(proto.open) && // eslint-disable-line security/detect-non-literal-fs-filename -- false positive
|
||||
!isNullOrUndefined(proto.send) &&
|
||||
!isNullOrUndefined(proto.abort);
|
||||
}
|
||||
|
@ -93,7 +93,9 @@ function _getFailedAjaxDiagnosticsMessage(xhr: XMLHttpRequestInstrumented): stri
|
|||
!isNullOrUndefined(xhr[strAjaxData].requestUrl)) {
|
||||
result += "(url: '" + xhr[strAjaxData].requestUrl + "')";
|
||||
}
|
||||
} catch (e) { }
|
||||
} catch (e) {
|
||||
// eslint-disable-next-line no-empty
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
|
|
@ -26,14 +26,14 @@
|
|||
"@microsoft/ai-test-framework": "0.0.1",
|
||||
"@microsoft/applicationinsights-rollup-plugin-uglify3-js": "1.0.0",
|
||||
"@microsoft/applicationinsights-rollup-es3": "1.1.3",
|
||||
"@microsoft/api-extractor": "^7.9.11",
|
||||
"typescript": "2.5.3",
|
||||
"tslib": "^1.13.0",
|
||||
"@microsoft/api-extractor": "^7.18.1",
|
||||
"typescript": "^4.3.4",
|
||||
"tslib": "^2.0.0",
|
||||
"grunt": "^1.4.1",
|
||||
"grunt-cli": "^1.4.3",
|
||||
"grunt-contrib-qunit": "^5.0.1",
|
||||
"grunt-run": "^0.8.1",
|
||||
"@nevware21/grunt-ts-plugin": "^0.4.3",
|
||||
"@nevware21/grunt-eslint-ts": "^0.2.1",
|
||||
"globby": "^11.0.0",
|
||||
"magic-string": "^0.25.7",
|
||||
"pako": "^2.0.3",
|
||||
|
@ -41,12 +41,11 @@
|
|||
"@rollup/plugin-node-resolve": "^11.2.1",
|
||||
"@rollup/plugin-replace": "^2.3.3",
|
||||
"rollup-plugin-cleanup": "3.2.1",
|
||||
"rollup": "^2.32.0",
|
||||
"tslint": "^5.19.0",
|
||||
"tslint-config-prettier": "^1.18.0",
|
||||
"qunit": "^2.11.2",
|
||||
"sinon": "^7.3.1"
|
||||
"rollup": "^2.32.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"tslib": "*"
|
||||
},
|
||||
"dependencies": {
|
||||
"@microsoft/dynamicproto-js": "^1.1.4",
|
||||
"@microsoft/applicationinsights-shims": "2.0.0",
|
||||
|
|
|
@ -4,4 +4,5 @@
|
|||
import { PerfMarkMeasureManager } from "./PerfMarkMeasureManager";
|
||||
import { IPerfMarkMeasureConfiguration } from "./interfaces/IPerfMarkMeasureConfiguration";
|
||||
|
||||
export { PerfMarkMeasureManager, IPerfMarkMeasureConfiguration };
|
||||
export { IPerfManagerProvider, IPerfManager, IPerfEvent, doPerf } from "@microsoft/applicationinsights-core-js";
|
||||
export {PerfMarkMeasureManager, IPerfMarkMeasureConfiguration };
|
||||
|
|
|
@ -26,14 +26,15 @@
|
|||
"@microsoft/ai-test-framework": "0.0.1",
|
||||
"@microsoft/applicationinsights-rollup-plugin-uglify3-js": "1.0.0",
|
||||
"@microsoft/applicationinsights-rollup-es3": "1.1.3",
|
||||
"@microsoft/api-extractor": "^7.9.11",
|
||||
"typescript": "2.5.3",
|
||||
"tslib": "^1.13.0",
|
||||
"@microsoft/api-extractor": "^7.18.1",
|
||||
"typescript": "^4.3.4",
|
||||
"tslib": "^2.0.0",
|
||||
"grunt": "^1.4.1",
|
||||
"grunt-cli": "^1.4.3",
|
||||
"grunt-contrib-qunit": "^5.0.1",
|
||||
"grunt-run": "^0.8.1",
|
||||
"@nevware21/grunt-ts-plugin": "^0.4.3",
|
||||
"@nevware21/grunt-eslint-ts": "^0.2.1",
|
||||
"globby": "^11.0.0",
|
||||
"magic-string": "^0.25.7",
|
||||
"pako": "^2.0.3",
|
||||
|
@ -42,11 +43,12 @@
|
|||
"@rollup/plugin-replace": "^2.3.3",
|
||||
"rollup-plugin-cleanup": "3.2.1",
|
||||
"rollup": "^2.32.0",
|
||||
"tslint": "^5.19.0",
|
||||
"tslint-config-prettier": "^1.18.0",
|
||||
"qunit": "^2.11.2",
|
||||
"sinon": "^7.3.1"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"tslib": "*"
|
||||
},
|
||||
"dependencies": {
|
||||
"@microsoft/dynamicproto-js": "^1.1.4",
|
||||
"@microsoft/applicationinsights-shims": "2.0.0",
|
||||
|
|
|
@ -0,0 +1,361 @@
|
|||
/**
|
||||
* Config file for API Extractor. For more info, please visit: https://api-extractor.com
|
||||
*/
|
||||
{
|
||||
"$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
|
||||
|
||||
/**
|
||||
* Optionally specifies another JSON config file that this file extends from. This provides a way for
|
||||
* standard settings to be shared across multiple projects.
|
||||
*
|
||||
* If the path starts with "./" or "../", the path is resolved relative to the folder of the file that contains
|
||||
* the "extends" field. Otherwise, the first path segment is interpreted as an NPM package name, and will be
|
||||
* resolved using NodeJS require().
|
||||
*
|
||||
* SUPPORTED TOKENS: none
|
||||
* DEFAULT VALUE: ""
|
||||
*/
|
||||
// "extends": "./shared/api-extractor-base.json"
|
||||
// "extends": "my-package/include/api-extractor-base.json"
|
||||
|
||||
/**
|
||||
* Determines the "<projectFolder>" token that can be used with other config file settings. The project folder
|
||||
* typically contains the tsconfig.json and package.json config files, but the path is user-defined.
|
||||
*
|
||||
* The path is resolved relative to the folder of the config file that contains the setting.
|
||||
*
|
||||
* The default value for "projectFolder" is the token "<lookup>", which means the folder is determined by traversing
|
||||
* parent folders, starting from the folder containing api-extractor.json, and stopping at the first folder
|
||||
* that contains a tsconfig.json file. If a tsconfig.json file cannot be found in this way, then an error
|
||||
* will be reported.
|
||||
*
|
||||
* SUPPORTED TOKENS: <lookup>
|
||||
* DEFAULT VALUE: "<lookup>"
|
||||
*/
|
||||
"projectFolder": ".",
|
||||
|
||||
/**
|
||||
* (REQUIRED) Specifies the .d.ts file to be used as the starting point for analysis. API Extractor
|
||||
* analyzes the symbols exported by this module.
|
||||
*
|
||||
* The file extension must be ".d.ts" and not ".ts".
|
||||
*
|
||||
* The path is resolved relative to the folder of the config file that contains the setting; to change this,
|
||||
* prepend a folder token such as "<projectFolder>".
|
||||
*
|
||||
* SUPPORTED TOKENS: <projectFolder>, <packageName>, <unscopedPackageName>
|
||||
*/
|
||||
"mainEntryPointFilePath": "<projectFolder>/types/applicationinsights-react-js.d.ts",
|
||||
|
||||
/**
|
||||
* A list of NPM package names whose exports should be treated as part of this package.
|
||||
*
|
||||
* For example, suppose that Webpack is used to generate a distributed bundle for the project "library1",
|
||||
* and another NPM package "library2" is embedded in this bundle. Some types from library2 may become part
|
||||
* of the exported API for library1, but by default API Extractor would generate a .d.ts rollup that explicitly
|
||||
* imports library2. To avoid this, we can specify:
|
||||
*
|
||||
* "bundledPackages": [ "library2" ],
|
||||
*
|
||||
* This would direct API Extractor to embed those types directly in the .d.ts rollup, as if they had been
|
||||
* local files for library1.
|
||||
*/
|
||||
"bundledPackages": [
|
||||
],
|
||||
|
||||
/**
|
||||
* Determines how the TypeScript compiler engine will be invoked by API Extractor.
|
||||
*/
|
||||
"compiler": {
|
||||
/**
|
||||
* Specifies the path to the tsconfig.json file to be used by API Extractor when analyzing the project.
|
||||
*
|
||||
* The path is resolved relative to the folder of the config file that contains the setting; to change this,
|
||||
* prepend a folder token such as "<projectFolder>".
|
||||
*
|
||||
* Note: This setting will be ignored if "overrideTsconfig" is used.
|
||||
*
|
||||
* SUPPORTED TOKENS: <projectFolder>, <packageName>, <unscopedPackageName>
|
||||
* DEFAULT VALUE: "<projectFolder>/tsconfig.json"
|
||||
*/
|
||||
// "tsconfigFilePath": "<projectFolder>/tsconfig.json",
|
||||
|
||||
/**
|
||||
* Provides a compiler configuration that will be used instead of reading the tsconfig.json file from disk.
|
||||
* The object must conform to the TypeScript tsconfig schema:
|
||||
*
|
||||
* http://json.schemastore.org/tsconfig
|
||||
*
|
||||
* If omitted, then the tsconfig.json file will be read from the "projectFolder".
|
||||
*
|
||||
* DEFAULT VALUE: no overrideTsconfig section
|
||||
*/
|
||||
// "overrideTsconfig": {
|
||||
// . . .
|
||||
// }
|
||||
|
||||
/**
|
||||
* This option causes the compiler to be invoked with the --skipLibCheck option. This option is not recommended
|
||||
* and may cause API Extractor to produce incomplete or incorrect declarations, but it may be required when
|
||||
* dependencies contain declarations that are incompatible with the TypeScript engine that API Extractor uses
|
||||
* for its analysis. Where possible, the underlying issue should be fixed rather than relying on skipLibCheck.
|
||||
*
|
||||
* DEFAULT VALUE: false
|
||||
*/
|
||||
// "skipLibCheck": true,
|
||||
},
|
||||
|
||||
/**
|
||||
* Configures how the API report file (*.api.md) will be generated.
|
||||
*/
|
||||
"apiReport": {
|
||||
/**
|
||||
* (REQUIRED) Whether to generate an API report.
|
||||
*/
|
||||
"enabled": true,
|
||||
|
||||
/**
|
||||
* The filename for the API report files. It will be combined with "reportFolder" or "reportTempFolder" to produce
|
||||
* a full file path.
|
||||
*
|
||||
* The file extension should be ".api.md", and the string should not contain a path separator such as "\" or "/".
|
||||
*
|
||||
* SUPPORTED TOKENS: <packageName>, <unscopedPackageName>
|
||||
* DEFAULT VALUE: "<unscopedPackageName>.api.md"
|
||||
*/
|
||||
"reportFileName": "<unscopedPackageName>.api.md",
|
||||
|
||||
/**
|
||||
* Specifies the folder where the API report file is written. The file name portion is determined by
|
||||
* the "reportFileName" setting.
|
||||
*
|
||||
* The API report file is normally tracked by Git. Changes to it can be used to trigger a branch policy,
|
||||
* e.g. for an API review.
|
||||
*
|
||||
* The path is resolved relative to the folder of the config file that contains the setting; to change this,
|
||||
* prepend a folder token such as "<projectFolder>".
|
||||
*
|
||||
* SUPPORTED TOKENS: <projectFolder>, <packageName>, <unscopedPackageName>
|
||||
* DEFAULT VALUE: "<projectFolder>/etc/"
|
||||
*/
|
||||
"reportFolder": "<projectFolder>/dist/",
|
||||
|
||||
/**
|
||||
* Specifies the folder where the temporary report file is written. The file name portion is determined by
|
||||
* the "reportFileName" setting.
|
||||
*
|
||||
* After the temporary file is written to disk, it is compared with the file in the "reportFolder".
|
||||
* If they are different, a production build will fail.
|
||||
*
|
||||
* The path is resolved relative to the folder of the config file that contains the setting; to change this,
|
||||
* prepend a folder token such as "<projectFolder>".
|
||||
*
|
||||
* SUPPORTED TOKENS: <projectFolder>, <packageName>, <unscopedPackageName>
|
||||
* DEFAULT VALUE: "<projectFolder>/temp/"
|
||||
*/
|
||||
// "reportTempFolder": "<projectFolder>/temp/"
|
||||
},
|
||||
|
||||
/**
|
||||
* Configures how the doc model file (*.api.json) will be generated.
|
||||
*/
|
||||
"docModel": {
|
||||
/**
|
||||
* (REQUIRED) Whether to generate a doc model file.
|
||||
*/
|
||||
"enabled": true,
|
||||
|
||||
/**
|
||||
* The output path for the doc model file. The file extension should be ".api.json".
|
||||
*
|
||||
* The path is resolved relative to the folder of the config file that contains the setting; to change this,
|
||||
* prepend a folder token such as "<projectFolder>".
|
||||
*
|
||||
* SUPPORTED TOKENS: <projectFolder>, <packageName>, <unscopedPackageName>
|
||||
* DEFAULT VALUE: "<projectFolder>/temp/<unscopedPackageName>.api.json"
|
||||
*/
|
||||
"apiJsonFilePath": "<projectFolder>/dist/<unscopedPackageName>.api.json"
|
||||
},
|
||||
|
||||
/**
|
||||
* Configures how the .d.ts rollup file will be generated.
|
||||
*/
|
||||
"dtsRollup": {
|
||||
/**
|
||||
* (REQUIRED) Whether to generate the .d.ts rollup file.
|
||||
*/
|
||||
"enabled": true,
|
||||
|
||||
/**
|
||||
* Specifies the output path for a .d.ts rollup file to be generated without any trimming.
|
||||
* This file will include all declarations that are exported by the main entry point.
|
||||
*
|
||||
* If the path is an empty string, then this file will not be written.
|
||||
*
|
||||
* The path is resolved relative to the folder of the config file that contains the setting; to change this,
|
||||
* prepend a folder token such as "<projectFolder>".
|
||||
*
|
||||
* SUPPORTED TOKENS: <projectFolder>, <packageName>, <unscopedPackageName>
|
||||
* DEFAULT VALUE: "<projectFolder>/dist/<unscopedPackageName>.d.ts"
|
||||
*/
|
||||
"untrimmedFilePath": "<projectFolder>/dist/<unscopedPackageName>.d.ts",
|
||||
|
||||
/**
|
||||
* Specifies the output path for a .d.ts rollup file to be generated with trimming for a "beta" release.
|
||||
* This file will include only declarations that are marked as "@public" or "@beta".
|
||||
*
|
||||
* The path is resolved relative to the folder of the config file that contains the setting; to change this,
|
||||
* prepend a folder token such as "<projectFolder>".
|
||||
*
|
||||
* SUPPORTED TOKENS: <projectFolder>, <packageName>, <unscopedPackageName>
|
||||
* DEFAULT VALUE: ""
|
||||
*/
|
||||
// "betaTrimmedFilePath": "<projectFolder>/dist/<unscopedPackageName>-beta.d.ts",
|
||||
|
||||
|
||||
/**
|
||||
* Specifies the output path for a .d.ts rollup file to be generated with trimming for a "public" release.
|
||||
* This file will include only declarations that are marked as "@public".
|
||||
*
|
||||
* If the path is an empty string, then this file will not be written.
|
||||
*
|
||||
* The path is resolved relative to the folder of the config file that contains the setting; to change this,
|
||||
* prepend a folder token such as "<projectFolder>".
|
||||
*
|
||||
* SUPPORTED TOKENS: <projectFolder>, <packageName>, <unscopedPackageName>
|
||||
* DEFAULT VALUE: ""
|
||||
*/
|
||||
// "publicTrimmedFilePath": "<projectFolder>/dist/<unscopedPackageName>-public.d.ts",
|
||||
|
||||
/**
|
||||
* When a declaration is trimmed, by default it will be replaced by a code comment such as
|
||||
* "Excluded from this release type: exampleMember". Set "omitTrimmingComments" to true to remove the
|
||||
* declaration completely.
|
||||
*
|
||||
* DEFAULT VALUE: false
|
||||
*/
|
||||
// "omitTrimmingComments": true
|
||||
},
|
||||
|
||||
/**
|
||||
* Configures how the tsdoc-metadata.json file will be generated.
|
||||
*/
|
||||
"tsdocMetadata": {
|
||||
/**
|
||||
* Whether to generate the tsdoc-metadata.json file.
|
||||
*
|
||||
* DEFAULT VALUE: true
|
||||
*/
|
||||
// "enabled": true,
|
||||
|
||||
/**
|
||||
* Specifies where the TSDoc metadata file should be written.
|
||||
*
|
||||
* The path is resolved relative to the folder of the config file that contains the setting; to change this,
|
||||
* prepend a folder token such as "<projectFolder>".
|
||||
*
|
||||
* The default value is "<lookup>", which causes the path to be automatically inferred from the "tsdocMetadata",
|
||||
* "typings" or "main" fields of the project's package.json. If none of these fields are set, the lookup
|
||||
* falls back to "tsdoc-metadata.json" in the package folder.
|
||||
*
|
||||
* SUPPORTED TOKENS: <projectFolder>, <packageName>, <unscopedPackageName>
|
||||
* DEFAULT VALUE: "<lookup>"
|
||||
*/
|
||||
// "tsdocMetadataFilePath": "<projectFolder>/dist/tsdoc-metadata.json"
|
||||
},
|
||||
|
||||
/**
|
||||
* Configures how API Extractor reports error and warning messages produced during analysis.
|
||||
*
|
||||
* There are three sources of messages: compiler messages, API Extractor messages, and TSDoc messages.
|
||||
*/
|
||||
"messages": {
|
||||
/**
|
||||
* Configures handling of diagnostic messages reported by the TypeScript compiler engine while analyzing
|
||||
* the input .d.ts files.
|
||||
*
|
||||
* TypeScript message identifiers start with "TS" followed by an integer. For example: "TS2551"
|
||||
*
|
||||
* DEFAULT VALUE: A single "default" entry with logLevel=warning.
|
||||
*/
|
||||
"compilerMessageReporting": {
|
||||
/**
|
||||
* Configures the default routing for messages that don't match an explicit rule in this table.
|
||||
*/
|
||||
"default": {
|
||||
/**
|
||||
* Specifies whether the message should be written to the the tool's output log. Note that
|
||||
* the "addToApiReportFile" property may supersede this option.
|
||||
*
|
||||
* Possible values: "error", "warning", "none"
|
||||
*
|
||||
* Errors cause the build to fail and return a nonzero exit code. Warnings cause a production build fail
|
||||
* and return a nonzero exit code. For a non-production build (e.g. when "api-extractor run" includes
|
||||
* the "--local" option), the warning is displayed but the build will not fail.
|
||||
*
|
||||
* DEFAULT VALUE: "warning"
|
||||
*/
|
||||
"logLevel": "warning",
|
||||
|
||||
/**
|
||||
* When addToApiReportFile is true: If API Extractor is configured to write an API report file (.api.md),
|
||||
* then the message will be written inside that file; otherwise, the message is instead logged according to
|
||||
* the "logLevel" option.
|
||||
*
|
||||
* DEFAULT VALUE: false
|
||||
*/
|
||||
// "addToApiReportFile": false
|
||||
},
|
||||
|
||||
// "TS2551": {
|
||||
// "logLevel": "warning",
|
||||
// "addToApiReportFile": true
|
||||
// },
|
||||
//
|
||||
// . . .
|
||||
},
|
||||
|
||||
/**
|
||||
* Configures handling of messages reported by API Extractor during its analysis.
|
||||
*
|
||||
* API Extractor message identifiers start with "ae-". For example: "ae-extra-release-tag"
|
||||
*
|
||||
* DEFAULT VALUE: See api-extractor-defaults.json for the complete table of extractorMessageReporting mappings
|
||||
*/
|
||||
"extractorMessageReporting": {
|
||||
"default": {
|
||||
"logLevel": "warning",
|
||||
// "addToApiReportFile": false
|
||||
},
|
||||
|
||||
"ae-missing-release-tag": {
|
||||
"logLevel": "none"
|
||||
},
|
||||
//
|
||||
// . . .
|
||||
},
|
||||
|
||||
/**
|
||||
* Configures handling of messages reported by the TSDoc parser when analyzing code comments.
|
||||
*
|
||||
* TSDoc message identifiers start with "tsdoc-". For example: "tsdoc-link-tag-unescaped-text"
|
||||
*
|
||||
* DEFAULT VALUE: A single "default" entry with logLevel=warning.
|
||||
*/
|
||||
"tsdocMessageReporting": {
|
||||
"default": {
|
||||
"logLevel": "warning",
|
||||
// "addToApiReportFile": false
|
||||
}
|
||||
|
||||
// "tsdoc-link-tag-unescaped-text": {
|
||||
// "logLevel": "warning",
|
||||
// "addToApiReportFile": true
|
||||
// },
|
||||
//
|
||||
// . . .
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -11,16 +11,20 @@
|
|||
"url": "https://github.com/microsoft/ApplicationInsights-JS/tree/master/extensions/applicationinsights-react-js"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "npm run build:esm && npm run build:browser",
|
||||
"build": "npm run build:esm && npm run build:package && npm run dtsgen",
|
||||
"build:esm": "tsc -p tsconfig.json",
|
||||
"build:browser": "rollup -c",
|
||||
"build:package": "rollup -c",
|
||||
"rebuild": "npm run build",
|
||||
"testx": "grunt reacttests",
|
||||
"test": "jest --config test/jestconfig.json",
|
||||
"test-watch": "jest --config test/jestconfig.json --watch",
|
||||
"lint": "tslint -p tsconfig.json"
|
||||
"lint": "tslint -p tsconfig.json",
|
||||
"dtsgen": "api-extractor run --local && node ../../scripts/dtsgen.js \"Microsoft Application Insights react plugin\""
|
||||
},
|
||||
"devDependencies": {
|
||||
"@microsoft/ai-test-framework": "0.0.1",
|
||||
"@microsoft/applicationinsights-rollup-es3": "1.1.3",
|
||||
"@microsoft/api-extractor": "^7.9.11",
|
||||
"@microsoft/api-extractor": "^7.18.1",
|
||||
"@testing-library/dom": "^7.29.6",
|
||||
"@testing-library/jest-dom": "^5.11.9",
|
||||
"@testing-library/react": "^11.2.5",
|
||||
|
@ -47,20 +51,19 @@
|
|||
"rollup-plugin-peer-deps-external": "^2.2.4",
|
||||
"rollup": "^2.32.0",
|
||||
"ts-jest": "^24.0.2",
|
||||
"tslint": "^5.19.0",
|
||||
"tslint-config-prettier": "^1.18.0",
|
||||
"typescript": "^3.9.3",
|
||||
"typescript": "^4.3.4",
|
||||
"tslib": "^2.0.0",
|
||||
"uglify-js": "^3.11.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"@microsoft/applicationinsights-shims": "^2.0.0",
|
||||
"@microsoft/applicationinsights-core-js": "^2.6.5",
|
||||
"@microsoft/applicationinsights-common": "^2.6.5",
|
||||
"@microsoft/applicationinsights-shims": "2.0.0",
|
||||
"@microsoft/applicationinsights-core-js": "2.6.5",
|
||||
"@microsoft/applicationinsights-common": "2.6.5",
|
||||
"@microsoft/dynamicproto-js": "^1.1.4",
|
||||
"history": "^4.10.1"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"tslib": "*",
|
||||
"react": "^17.0.1"
|
||||
},
|
||||
"license": "MIT"
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
import { createContext, useContext } from "react";
|
||||
import { createContext, useContext, Context } from "react";
|
||||
import ReactPlugin from "./ReactPlugin";
|
||||
|
||||
const AppInsightsContext = createContext<ReactPlugin>(undefined);
|
||||
export declare type AppInsightsReactContext = Context<ReactPlugin>
|
||||
const AppInsightsContext = createContext<ReactPlugin>(undefined) as AppInsightsReactContext;
|
||||
|
||||
const useAppInsightsContext = () => useContext(AppInsightsContext);
|
||||
|
||||
|
|
|
@ -2,15 +2,17 @@
|
|||
* ReactPlugin.ts
|
||||
* @copyright Microsoft 2019
|
||||
*/
|
||||
import { useState, useEffect, useRef } from "react";
|
||||
import { useState, useEffect, useRef, Dispatch, SetStateAction } from "react";
|
||||
import ReactPlugin from "./ReactPlugin";
|
||||
|
||||
export type AIReactCustomEvent<T> = Dispatch<SetStateAction<T>>;
|
||||
|
||||
export default function useCustomEvent<T>(
|
||||
reactPlugin: ReactPlugin,
|
||||
eventName: string,
|
||||
eventData: T,
|
||||
skipFirstRun = true
|
||||
) {
|
||||
): AIReactCustomEvent<T> {
|
||||
const [data, setData] = useState(eventData);
|
||||
const firstRun = useRef(skipFirstRun);
|
||||
|
||||
|
@ -22,5 +24,5 @@ export default function useCustomEvent<T>(
|
|||
reactPlugin.trackEvent({ name: eventName }, data);
|
||||
}, [reactPlugin, data, eventName]);
|
||||
|
||||
return setData;
|
||||
return setData as AIReactCustomEvent<T>;
|
||||
}
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
"noImplicitAny": true,
|
||||
"module": "es6",
|
||||
"moduleResolution": "Node",
|
||||
"target": "es3",
|
||||
"target": "es5",
|
||||
"jsx": "react",
|
||||
"alwaysStrict": true,
|
||||
"suppressImplicitAnyIndexErrors": true,
|
||||
|
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -1,723 +0,0 @@
|
|||
// Type definitions for QUnit 1.10
|
||||
// Project: http://qunitjs.com/
|
||||
// Definitions by: Diullei Gomes <https://github.com/diullei>
|
||||
// DefinitelyTyped: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
|
||||
interface DoneCallbackObject {
|
||||
/**
|
||||
* The number of failed assertions
|
||||
*/
|
||||
failed: number;
|
||||
|
||||
/**
|
||||
* The number of passed assertions
|
||||
*/
|
||||
passed: number;
|
||||
|
||||
/**
|
||||
* The total number of assertions
|
||||
*/
|
||||
total: number;
|
||||
|
||||
/**
|
||||
* The time in milliseconds it took tests to run from start to finish.
|
||||
*/
|
||||
runtime: number;
|
||||
}
|
||||
|
||||
interface LogCallbackObject {
|
||||
/**
|
||||
* The boolean result of an assertion, true means passed, false means failed.
|
||||
*/
|
||||
result: boolean;
|
||||
|
||||
/**
|
||||
* One side of a comparision assertion. Can be undefined when ok() is used.
|
||||
*/
|
||||
actual: Object;
|
||||
|
||||
/**
|
||||
* One side of a comparision assertion. Can be undefined when ok() is used.
|
||||
*/
|
||||
expected: Object;
|
||||
|
||||
/**
|
||||
* A string description provided by the assertion.
|
||||
*/
|
||||
message: string;
|
||||
|
||||
/**
|
||||
* The associated stacktrace, either from an exception or pointing to the source
|
||||
* of the assertion. Depends on browser support for providing stacktraces, so can be
|
||||
* undefined.
|
||||
*/
|
||||
source: string;
|
||||
}
|
||||
|
||||
interface ModuleStartCallbackObject {
|
||||
/**
|
||||
* Name of the next module to run
|
||||
*/
|
||||
name: string;
|
||||
}
|
||||
|
||||
interface ModuleDoneCallbackObject {
|
||||
/**
|
||||
* Name of this module
|
||||
*/
|
||||
name: string;
|
||||
|
||||
/**
|
||||
* The number of failed assertions
|
||||
*/
|
||||
failed: number;
|
||||
|
||||
/**
|
||||
* The number of passed assertions
|
||||
*/
|
||||
passed: number;
|
||||
|
||||
/**
|
||||
* The total number of assertions
|
||||
*/
|
||||
total: number;
|
||||
}
|
||||
|
||||
interface TestDoneCallbackObject {
|
||||
/**
|
||||
* TName of the next test to run
|
||||
*/
|
||||
name: string;
|
||||
|
||||
/**
|
||||
* Name of the current module
|
||||
*/
|
||||
module: string;
|
||||
|
||||
/**
|
||||
* The number of failed assertions
|
||||
*/
|
||||
failed: number;
|
||||
|
||||
/**
|
||||
* The number of passed assertions
|
||||
*/
|
||||
passed: number;
|
||||
|
||||
/**
|
||||
* The total number of assertions
|
||||
*/
|
||||
total: number;
|
||||
|
||||
/**
|
||||
* The total runtime, including setup and teardown
|
||||
*/
|
||||
duration: number;
|
||||
}
|
||||
|
||||
interface TestStartCallbackObject {
|
||||
/**
|
||||
* Name of the next test to run
|
||||
*/
|
||||
name: string;
|
||||
|
||||
/**
|
||||
* Name of the current module
|
||||
*/
|
||||
module: string;
|
||||
}
|
||||
|
||||
interface Config {
|
||||
altertitle: boolean;
|
||||
autostart: boolean;
|
||||
current: Object;
|
||||
reorder: boolean;
|
||||
requireExpects: boolean;
|
||||
testTimeout: number;
|
||||
urlConfig: Array<URLConfigItem>;
|
||||
done: any;
|
||||
}
|
||||
|
||||
interface URLConfigItem {
|
||||
id: string;
|
||||
label: string;
|
||||
tooltip: string;
|
||||
}
|
||||
|
||||
interface LifecycleObject {
|
||||
/**
|
||||
* Runs before each test
|
||||
*/
|
||||
setup?: () => any;
|
||||
|
||||
/**
|
||||
* Runs after each test
|
||||
*/
|
||||
teardown?: () => any;
|
||||
}
|
||||
|
||||
interface QUnitAssert {
|
||||
/* ASSERT */
|
||||
assert: any;
|
||||
current_testEnvironment: any;
|
||||
jsDump: any;
|
||||
|
||||
/**
|
||||
* A deep recursive comparison assertion, working on primitive types, arrays, objects,
|
||||
* regular expressions, dates and functions.
|
||||
*
|
||||
* The deepEqual() assertion can be used just like equal() when comparing the value of
|
||||
* objects, such that { key: value } is equal to { key: value }. For non-scalar values,
|
||||
* identity will be disregarded by deepEqual.
|
||||
*
|
||||
* @param actual Object or Expression being tested
|
||||
* @param expected Known comparison value
|
||||
* @param message A short description of the assertion
|
||||
*/
|
||||
deepEqual(actual: any, expected: any, message?: string): any;
|
||||
|
||||
/**
|
||||
* A non-strict comparison assertion, roughly equivalent to JUnit assertEquals.
|
||||
*
|
||||
* The equal assertion uses the simple comparison operator (==) to compare the actual
|
||||
* and expected arguments. When they are equal, the assertion passes: any; otherwise, it fails.
|
||||
* When it fails, both actual and expected values are displayed in the test result,
|
||||
* in addition to a given message.
|
||||
*
|
||||
* @param actual Expression being tested
|
||||
* @param expected Known comparison value
|
||||
* @param message A short description of the assertion
|
||||
*/
|
||||
equal(actual: any, expected: any, message?: string): any;
|
||||
|
||||
/**
|
||||
* An inverted deep recursive comparison assertion, working on primitive types,
|
||||
* arrays, objects, regular expressions, dates and functions.
|
||||
*
|
||||
* The notDeepEqual() assertion can be used just like equal() when comparing the
|
||||
* value of objects, such that { key: value } is equal to { key: value }. For non-scalar
|
||||
* values, identity will be disregarded by notDeepEqual.
|
||||
*
|
||||
* @param actual Object or Expression being tested
|
||||
* @param expected Known comparison value
|
||||
* @param message A short description of the assertion
|
||||
*/
|
||||
notDeepEqual(actual: any, expected: any, message?: string): any;
|
||||
|
||||
/**
|
||||
* A non-strict comparison assertion, checking for inequality.
|
||||
*
|
||||
* The notEqual assertion uses the simple inverted comparison operator (!=) to compare
|
||||
* the actual and expected arguments. When they aren't equal, the assertion passes: any;
|
||||
* otherwise, it fails. When it fails, both actual and expected values are displayed
|
||||
* in the test result, in addition to a given message.
|
||||
*
|
||||
* @param actual Expression being tested
|
||||
* @param expected Known comparison value
|
||||
* @param message A short description of the assertion
|
||||
*/
|
||||
notEqual(actual: any, expected: any, message?: string): any;
|
||||
|
||||
notPropEqual(actual: any, expected: any, message?: string): any;
|
||||
|
||||
propEqual(actual: any, expected: any, message?: string): any;
|
||||
|
||||
/**
|
||||
* A non-strict comparison assertion, checking for inequality.
|
||||
*
|
||||
* The notStrictEqual assertion uses the strict inverted comparison operator (!==)
|
||||
* to compare the actual and expected arguments. When they aren't equal, the assertion
|
||||
* passes: any; otherwise, it fails. When it fails, both actual and expected values are
|
||||
* displayed in the test result, in addition to a given message.
|
||||
*
|
||||
* @param actual Expression being tested
|
||||
* @param expected Known comparison value
|
||||
* @param message A short description of the assertion
|
||||
*/
|
||||
notStrictEqual(actual: any, expected: any, message?: string): any;
|
||||
|
||||
/**
|
||||
* A boolean assertion, equivalent to CommonJS’s assert.ok() and JUnit’s assertTrue().
|
||||
* Passes if the first argument is truthy.
|
||||
*
|
||||
* The most basic assertion in QUnit, ok() requires just one argument. If the argument
|
||||
* evaluates to true, the assertion passes; otherwise, it fails. If a second message
|
||||
* argument is provided, it will be displayed in place of the result.
|
||||
*
|
||||
* @param state Expression being tested
|
||||
* @param message A short description of the assertion
|
||||
*/
|
||||
ok(state: any, message?: string): any;
|
||||
|
||||
/**
|
||||
* A strict type and value comparison assertion.
|
||||
*
|
||||
* The strictEqual() assertion provides the most rigid comparison of type and value with
|
||||
* the strict equality operator (===)
|
||||
*
|
||||
* @param actual Expression being tested
|
||||
* @param expected Known comparison value
|
||||
* @param message A short description of the assertion
|
||||
*/
|
||||
strictEqual(actual: any, expected: any, message?: string): any;
|
||||
|
||||
/**
|
||||
* Assertion to test if a callback throws an exception when run.
|
||||
*
|
||||
* When testing code that is expected to throw an exception based on a specific set of
|
||||
* circumstances, use throws() to catch the error object for testing and comparison.
|
||||
*
|
||||
* @param block Function to execute
|
||||
* @param expected Error Object to compare
|
||||
* @param message A short description of the assertion
|
||||
*/
|
||||
throws(block: () => any, expected: any, message?: string): any;
|
||||
|
||||
/**
|
||||
* @param block Function to execute
|
||||
* @param message A short description of the assertion
|
||||
*/
|
||||
throws(block: () => any, message?: string): any;
|
||||
}
|
||||
|
||||
interface QUnitStatic extends QUnitAssert{
|
||||
/* ASYNC CONTROL */
|
||||
|
||||
/**
|
||||
* Start running tests again after the testrunner was stopped. See stop().
|
||||
*
|
||||
* When your async test has multiple exit points, call start() for the corresponding number of stop() increments.
|
||||
*
|
||||
* @param decrement Optional argument to merge multiple start() calls into one. Use with multiple corrsponding stop() calls.
|
||||
*/
|
||||
start(decrement?: number): any;
|
||||
|
||||
/**
|
||||
* Stop the testrunner to wait for async tests to run. Call start() to continue.
|
||||
*
|
||||
* When your async test has multiple exit points, call stop() with the increment argument, corresponding to the number of start() calls you need.
|
||||
*
|
||||
* On Blackberry 5.0, window.stop is a native read-only function. If you deal with that browser, use QUnit.stop() instead, which will work anywhere.
|
||||
*
|
||||
* @param decrement Optional argument to merge multiple stop() calls into one. Use with multiple corrsponding start() calls.
|
||||
*/
|
||||
stop(increment? : number): any;
|
||||
|
||||
/* CALLBACKS */
|
||||
|
||||
/**
|
||||
* Register a callback to fire whenever the test suite begins.
|
||||
*
|
||||
* QUnit.begin() is called once before running any tests. (a better would've been QUnit.start,
|
||||
* but thats already in use elsewhere and can't be changed.)
|
||||
*
|
||||
* @param callback Callback to execute
|
||||
*/
|
||||
begin(callback: () => any): any;
|
||||
|
||||
/**
|
||||
* Register a callback to fire whenever the test suite ends.
|
||||
*
|
||||
* @param callback Callback to execute.
|
||||
*/
|
||||
done(callback: (details: DoneCallbackObject) => any): any;
|
||||
|
||||
/**
|
||||
* Register a callback to fire whenever an assertion completes.
|
||||
*
|
||||
* This is one of several callbacks QUnit provides. Its intended for integration scenarios like
|
||||
* PhantomJS or Jenkins. The properties of the details argument are listed below as options.
|
||||
*
|
||||
* @param callback Callback to execute.
|
||||
*/
|
||||
log(callback: (details: LogCallbackObject) => any): any;
|
||||
|
||||
/**
|
||||
* Register a callback to fire whenever a module ends.
|
||||
*
|
||||
* @param callback Callback to execute.
|
||||
*/
|
||||
moduleDone(callback: (details: ModuleDoneCallbackObject) => any): any;
|
||||
|
||||
/**
|
||||
* Register a callback to fire whenever a module begins.
|
||||
*
|
||||
* @param callback Callback to execute.
|
||||
*/
|
||||
moduleStart(callback: (details: ModuleStartCallbackObject) => any): any;
|
||||
|
||||
/**
|
||||
* Register a callback to fire whenever a test ends.
|
||||
*
|
||||
* @param callback Callback to execute.
|
||||
*/
|
||||
testDone(callback: (details: TestDoneCallbackObject) => any): any;
|
||||
|
||||
/**
|
||||
* Register a callback to fire whenever a test begins.
|
||||
*
|
||||
* @param callback Callback to execute.
|
||||
*/
|
||||
testStart(callback: (details: TestStartCallbackObject) => any): any;
|
||||
|
||||
/* CONFIGURATION */
|
||||
|
||||
/**
|
||||
* QUnit has a bunch of internal configuration defaults, some of which are
|
||||
* useful to override. Check the description for each option for details.
|
||||
*/
|
||||
config: Config;
|
||||
|
||||
/* TEST */
|
||||
|
||||
/**
|
||||
* Add an asynchronous test to run. The test must include a call to start().
|
||||
*
|
||||
* For testing asynchronous code, asyncTest will automatically stop the test runner
|
||||
* and wait for your code to call start() to continue.
|
||||
*
|
||||
* @param name Title of unit being tested
|
||||
* @param expected Number of assertions in this test
|
||||
* @param test Function to close over assertions
|
||||
*/
|
||||
asyncTest(name: string, expected: number, test: () => any): any;
|
||||
|
||||
/**
|
||||
* Add an asynchronous test to run. The test must include a call to start().
|
||||
*
|
||||
* For testing asynchronous code, asyncTest will automatically stop the test runner
|
||||
* and wait for your code to call start() to continue.
|
||||
*
|
||||
* @param name Title of unit being tested
|
||||
* @param test Function to close over assertions
|
||||
*/
|
||||
asyncTest(name: string, test: () => any): any;
|
||||
|
||||
/**
|
||||
* Specify how many assertions are expected to run within a test.
|
||||
*
|
||||
* To ensure that an explicit number of assertions are run within any test, use
|
||||
* expect( number ) to register an expected count. If the number of assertions
|
||||
* run does not match the expected count, the test will fail.
|
||||
*
|
||||
* @param amount Number of assertions in this test.
|
||||
*/
|
||||
expect(amount: number): any;
|
||||
|
||||
/**
|
||||
* Group related tests under a single label.
|
||||
*
|
||||
* All tests that occur after a call to module() will be grouped into that module.
|
||||
* The test names will all be preceded by the module name in the test results.
|
||||
* You can then use that module name to select tests to run.
|
||||
*
|
||||
* @param name Label for this group of tests
|
||||
* @param lifecycle Callbacks to run before and after each test
|
||||
*/
|
||||
module(name: string, lifecycle?: LifecycleObject): any;
|
||||
|
||||
/**
|
||||
* Add a test to run.
|
||||
*
|
||||
* When testing the most common, synchronous code, use test().
|
||||
* The assert argument to the callback contains all of QUnit's assertion methods.
|
||||
* If you are avoiding using any of QUnit's globals, you can use the assert
|
||||
* argument instead.
|
||||
*
|
||||
* @param title Title of unit being tested
|
||||
* @param expected Number of assertions in this test
|
||||
* @param test Function to close over assertions
|
||||
*/
|
||||
test(title: string, expected: number, test: (assert: QUnitAssert) => any): any;
|
||||
|
||||
/**
|
||||
* @param title Title of unit being tested
|
||||
* @param test Function to close over assertions
|
||||
*/
|
||||
test(title: string, test: (assert: QUnitAssert) => any): any;
|
||||
|
||||
/**
|
||||
* https://github.com/jquery/qunit/blob/master/qunit/qunit.js#L1568
|
||||
*/
|
||||
equiv(a: any, b: any): any;
|
||||
|
||||
// https://github.com/jquery/qunit/blob/master/qunit/qunit.js#L661
|
||||
raises: any;
|
||||
|
||||
/**
|
||||
* https://github.com/jquery/qunit/blob/master/qunit/qunit.js#L897
|
||||
*/
|
||||
push(result: any, actual: any, expected: any, message: string): any;
|
||||
|
||||
/**
|
||||
* https://github.com/jquery/qunit/blob/master/qunit/qunit.js#L839
|
||||
*/
|
||||
reset(): any;
|
||||
}
|
||||
|
||||
/* ASSERT */
|
||||
|
||||
/**
|
||||
* A deep recursive comparison assertion, working on primitive types, arrays, objects,
|
||||
* regular expressions, dates and functions.
|
||||
*
|
||||
* The deepEqual() assertion can be used just like equal() when comparing the value of
|
||||
* objects, such that { key: value } is equal to { key: value }. For non-scalar values,
|
||||
* identity will be disregarded by deepEqual.
|
||||
*
|
||||
* @param actual Object or Expression being tested
|
||||
* @param expected Known comparison value
|
||||
* @param message A short description of the assertion
|
||||
*/
|
||||
declare function deepEqual(actual: any, expected: any, message?: string): any;
|
||||
|
||||
/**
|
||||
* A non-strict comparison assertion, roughly equivalent to JUnit assertEquals.
|
||||
*
|
||||
* The equal assertion uses the simple comparison operator (==) to compare the actual
|
||||
* and expected arguments. When they are equal, the assertion passes: any; otherwise, it fails.
|
||||
* When it fails, both actual and expected values are displayed in the test result,
|
||||
* in addition to a given message.
|
||||
*
|
||||
* @param actual Expression being tested
|
||||
* @param expected Known comparison value
|
||||
* @param message A short description of the assertion
|
||||
*/
|
||||
declare function equal(actual: any, expected: any, message?: string): any;
|
||||
|
||||
/**
|
||||
* An inverted deep recursive comparison assertion, working on primitive types,
|
||||
* arrays, objects, regular expressions, dates and functions.
|
||||
*
|
||||
* The notDeepEqual() assertion can be used just like equal() when comparing the
|
||||
* value of objects, such that { key: value } is equal to { key: value }. For non-scalar
|
||||
* values, identity will be disregarded by notDeepEqual.
|
||||
*
|
||||
* @param actual Object or Expression being tested
|
||||
* @param expected Known comparison value
|
||||
* @param message A short description of the assertion
|
||||
*/
|
||||
declare function notDeepEqual(actual: any, expected: any, message?: string): any;
|
||||
|
||||
/**
|
||||
* A non-strict comparison assertion, checking for inequality.
|
||||
*
|
||||
* The notEqual assertion uses the simple inverted comparison operator (!=) to compare
|
||||
* the actual and expected arguments. When they aren't equal, the assertion passes;
|
||||
* otherwise, it fails. When it fails, both actual and expected values are displayed
|
||||
* in the test result, in addition to a given message.
|
||||
*
|
||||
* @param actual Expression being tested
|
||||
* @param expected Known comparison value
|
||||
* @param message A short description of the assertion
|
||||
*/
|
||||
declare function notEqual(actual: any, expected: any, message?: string): any;
|
||||
|
||||
/**
|
||||
* A non-strict comparison assertion, checking for inequality.
|
||||
*
|
||||
* The notStrictEqual assertion uses the strict inverted comparison operator (!==)
|
||||
* to compare the actual and expected arguments. When they aren't equal, the assertion
|
||||
* passes; otherwise, it fails. When it fails, both actual and expected values are
|
||||
* displayed in the test result, in addition to a given message.
|
||||
*
|
||||
* @param actual Expression being tested
|
||||
* @param expected Known comparison value
|
||||
* @param message A short description of the assertion
|
||||
*/
|
||||
declare function notStrictEqual(actual: any, expected: any, message?: string): any;
|
||||
|
||||
/**
|
||||
* A boolean assertion, equivalent to CommonJS’s assert.ok() and JUnit’s assertTrue().
|
||||
* Passes if the first argument is truthy.
|
||||
*
|
||||
* The most basic assertion in QUnit, ok() requires just one argument. If the argument
|
||||
* evaluates to true, the assertion passes; otherwise, it fails. If a second message
|
||||
* argument is provided, it will be displayed in place of the result.
|
||||
*
|
||||
* @param state Expression being tested
|
||||
* @param message A short description of the assertion
|
||||
*/
|
||||
declare function ok(state: any, message?: string): any;
|
||||
|
||||
/**
|
||||
* A strict type and value comparison assertion.
|
||||
*
|
||||
* The strictEqual() assertion provides the most rigid comparison of type and value with
|
||||
* the strict equality operator (===)
|
||||
*
|
||||
* @param actual Expression being tested
|
||||
* @param expected Known comparison value
|
||||
* @param message A short description of the assertion
|
||||
*/
|
||||
declare function strictEqual(actual: any, expected: any, message?: string): any;
|
||||
|
||||
/**
|
||||
* Assertion to test if a callback throws an exception when run.
|
||||
*
|
||||
* When testing code that is expected to throw an exception based on a specific set of
|
||||
* circumstances, use throws() to catch the error object for testing and comparison.
|
||||
*
|
||||
* @param block Function to execute
|
||||
* @param expected Error Object to compare
|
||||
* @param message A short description of the assertion
|
||||
*/
|
||||
declare function throws(block: () => any, expected: any, message?: string): any;
|
||||
|
||||
/**
|
||||
* @param block Function to execute
|
||||
* @param message A short description of the assertion
|
||||
*/
|
||||
declare function throws(block: () => any, message?: string): any;
|
||||
|
||||
/* ASYNC CONTROL */
|
||||
|
||||
/**
|
||||
* Start running tests again after the testrunner was stopped. See stop().
|
||||
*
|
||||
* When your async test has multiple exit points, call start() for the corresponding number of stop() increments.
|
||||
*
|
||||
* @param decrement Optional argument to merge multiple start() calls into one. Use with multiple corrsponding stop() calls.
|
||||
*/
|
||||
declare function start(decrement?: number): any;
|
||||
|
||||
/**
|
||||
* Stop the testrunner to wait for async tests to run. Call start() to continue.
|
||||
*
|
||||
* When your async test has multiple exit points, call stop() with the increment argument, corresponding to the number of start() calls you need.
|
||||
*
|
||||
* On Blackberry 5.0, window.stop is a native read-only function. If you deal with that browser, use QUnit.stop() instead, which will work anywhere.
|
||||
*
|
||||
* @param decrement Optional argument to merge multiple stop() calls into one. Use with multiple corrsponding start() calls.
|
||||
*/
|
||||
declare function stop(increment? : number): any;
|
||||
|
||||
/* CALLBACKS */
|
||||
|
||||
/**
|
||||
* Register a callback to fire whenever the test suite begins.
|
||||
*
|
||||
* QUnit.begin() is called once before running any tests. (a better would've been QUnit.start,
|
||||
* but thats already in use elsewhere and can't be changed.)
|
||||
*
|
||||
* @param callback Callback to execute
|
||||
*/
|
||||
declare function begin(callback: () => any): any;
|
||||
|
||||
/**
|
||||
* Register a callback to fire whenever the test suite ends.
|
||||
*
|
||||
* @param callback Callback to execute.
|
||||
*/
|
||||
declare function done(callback: (details: DoneCallbackObject) => any): any;
|
||||
|
||||
/**
|
||||
* Register a callback to fire whenever an assertion completes.
|
||||
*
|
||||
* This is one of several callbacks QUnit provides. Its intended for integration scenarios like
|
||||
* PhantomJS or Jenkins. The properties of the details argument are listed below as options.
|
||||
*
|
||||
* @param callback Callback to execute.
|
||||
*/
|
||||
declare function log(callback: (details: LogCallbackObject) => any): any;
|
||||
|
||||
/**
|
||||
* Register a callback to fire whenever a module ends.
|
||||
*
|
||||
* @param callback Callback to execute.
|
||||
*/
|
||||
declare function moduleDone(callback: (details: ModuleDoneCallbackObject) => any): any;
|
||||
|
||||
/**
|
||||
* Register a callback to fire whenever a module begins.
|
||||
*
|
||||
* @param callback Callback to execute.
|
||||
*/
|
||||
declare function moduleStart(callback: (name: string) => any): any;
|
||||
|
||||
/**
|
||||
* Register a callback to fire whenever a test ends.
|
||||
*
|
||||
* @param callback Callback to execute.
|
||||
*/
|
||||
declare function testDone(callback: (details: TestDoneCallbackObject) => any): any;
|
||||
|
||||
/**
|
||||
* Register a callback to fire whenever a test begins.
|
||||
*
|
||||
* @param callback Callback to execute.
|
||||
*/
|
||||
declare function testStart(callback: (details: TestStartCallbackObject) => any): any;
|
||||
|
||||
/* TEST */
|
||||
|
||||
/**
|
||||
* Add an asynchronous test to run. The test must include a call to start().
|
||||
*
|
||||
* For testing asynchronous code, asyncTest will automatically stop the test runner
|
||||
* and wait for your code to call start() to continue.
|
||||
*
|
||||
* @param name Title of unit being tested
|
||||
* @param expected Number of assertions in this test
|
||||
* @param test Function to close over assertions
|
||||
*/
|
||||
declare function asyncTest(name: string, expected?: any, test?: () => any): any;
|
||||
|
||||
/**
|
||||
* Add an asynchronous test to run. The test must include a call to start().
|
||||
*
|
||||
* For testing asynchronous code, asyncTest will automatically stop the test runner
|
||||
* and wait for your code to call start() to continue.
|
||||
*
|
||||
* @param name Title of unit being tested
|
||||
* @param test Function to close over assertions
|
||||
*/
|
||||
declare function asyncTest(name: string, test: () => any): any;
|
||||
|
||||
/**
|
||||
* Specify how many assertions are expected to run within a test.
|
||||
*
|
||||
* To ensure that an explicit number of assertions are run within any test, use
|
||||
* expect( number ) to register an expected count. If the number of assertions
|
||||
* run does not match the expected count, the test will fail.
|
||||
*
|
||||
* @param amount Number of assertions in this test.
|
||||
*/
|
||||
declare function expect(amount: number): any;
|
||||
|
||||
// ** conflict with TypeScript module keyword. Must be used on QUnit namespace
|
||||
//declare var module: (name: string, lifecycle?: LifecycleObject) => any;
|
||||
|
||||
/**
|
||||
* Add a test to run.
|
||||
*
|
||||
* When testing the most common, synchronous code, use test().
|
||||
* The assert argument to the callback contains all of QUnit's assertion methods.
|
||||
* If you are avoiding using any of QUnit's globals, you can use the assert
|
||||
* argument instead.
|
||||
*
|
||||
* @param title Title of unit being tested
|
||||
* @param expected Number of assertions in this test
|
||||
* @param test Function to close over assertions
|
||||
*/
|
||||
declare function test(title: string, expected: number, test: (assert?: QUnitAssert) => any): any;
|
||||
|
||||
/**
|
||||
* @param title Title of unit being tested
|
||||
* @param test Function to close over assertions
|
||||
*/
|
||||
declare function test(title: string, test: (assert?: QUnitAssert) => any): any;
|
||||
|
||||
declare function notPropEqual(actual: any, expected: any, message?: string): any;
|
||||
|
||||
declare function propEqual(actual: any, expected: any, message?: string): any;
|
||||
|
||||
// https://github.com/jquery/qunit/blob/master/qunit/qunit.js#L1568
|
||||
declare function equiv(a: any, b: any): any;
|
||||
|
||||
// https://github.com/jquery/qunit/blob/master/qunit/qunit.js#L661
|
||||
declare var raises: any;
|
||||
|
||||
/* QUNIT */
|
||||
declare var QUnit: QUnitStatic;
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -1,434 +0,0 @@
|
|||
// Type definitions for Sinon 1.16.0
|
||||
// Project: http://sinonjs.org/
|
||||
// Definitions by: William Sears <https://github.com/mrbigdog2u>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
|
||||
interface SinonSpyCallApi {
|
||||
// Properties
|
||||
thisValue: any;
|
||||
args: any[];
|
||||
exception: any;
|
||||
returnValue: any;
|
||||
|
||||
// Methods
|
||||
calledOn(obj: any): boolean;
|
||||
calledWith(...args: any[]): boolean;
|
||||
calledWithExactly(...args: any[]): boolean;
|
||||
calledWithMatch(...args: any[]): boolean;
|
||||
notCalledWith(...args: any[]): boolean;
|
||||
notCalledWithMatch(...args: any[]): boolean;
|
||||
returned(value: any): boolean;
|
||||
threw(): boolean;
|
||||
threw(type: string): boolean;
|
||||
threw(obj: any): boolean;
|
||||
callArg(pos: number): void;
|
||||
callArgOn(pos: number, obj: any, ...args: any[]): void;
|
||||
callArgWith(pos: number, ...args: any[]): void;
|
||||
callArgOnWith(pos: number, obj: any, ...args: any[]): void;
|
||||
yield(...args: any[]): void;
|
||||
yieldOn(obj: any, ...args: any[]): void;
|
||||
yieldTo(property: string, ...args: any[]): void;
|
||||
yieldToOn(property: string, obj: any, ...args: any[]): void;
|
||||
}
|
||||
|
||||
interface SinonSpyCall extends SinonSpyCallApi {
|
||||
calledBefore(call: SinonSpyCall): boolean;
|
||||
calledAfter(call: SinonSpyCall): boolean;
|
||||
calledWithNew(call: SinonSpyCall): boolean;
|
||||
}
|
||||
|
||||
interface SinonSpy extends SinonSpyCallApi {
|
||||
// Properties
|
||||
callCount: number;
|
||||
called: boolean;
|
||||
notCalled: boolean;
|
||||
calledOnce: boolean;
|
||||
calledTwice: boolean;
|
||||
calledThrice: boolean;
|
||||
firstCall: SinonSpyCall;
|
||||
secondCall: SinonSpyCall;
|
||||
thirdCall: SinonSpyCall;
|
||||
lastCall: SinonSpyCall;
|
||||
thisValues: any[];
|
||||
args: any[][];
|
||||
exceptions: any[];
|
||||
returnValues: any[];
|
||||
|
||||
// Methods
|
||||
(...args: any[]): any;
|
||||
calledBefore(anotherSpy: SinonSpy): boolean;
|
||||
calledAfter(anotherSpy: SinonSpy): boolean;
|
||||
calledWithNew(spy: SinonSpy): boolean;
|
||||
withArgs(...args: any[]): SinonSpy;
|
||||
alwaysCalledOn(obj: any): boolean;
|
||||
alwaysCalledWith(...args: any[]): boolean;
|
||||
alwaysCalledWithExactly(...args: any[]): boolean;
|
||||
alwaysCalledWithMatch(...args: any[]): boolean;
|
||||
neverCalledWith(...args: any[]): boolean;
|
||||
neverCalledWithMatch(...args: any[]): boolean;
|
||||
alwaysThrew(): boolean;
|
||||
alwaysThrew(type: string): boolean;
|
||||
alwaysThrew(obj: any): boolean;
|
||||
alwaysReturned(): boolean;
|
||||
invokeCallback(...args: any[]): void;
|
||||
getCall(n: number): SinonSpyCall;
|
||||
reset(): void;
|
||||
printf(format: string, ...args: any[]): string;
|
||||
restore(): void;
|
||||
}
|
||||
|
||||
interface SinonSpyStatic {
|
||||
(): SinonSpy;
|
||||
(func: any): SinonSpy;
|
||||
(obj: any, method: string): SinonSpy;
|
||||
}
|
||||
|
||||
interface SinonStatic {
|
||||
spy: SinonSpyStatic;
|
||||
}
|
||||
|
||||
interface SinonStub extends SinonSpy {
|
||||
resetBehavior(): void;
|
||||
returns(obj: any): SinonStub;
|
||||
returnsArg(index: number): SinonStub;
|
||||
throws(type?: string): SinonStub;
|
||||
throws(obj: any): SinonStub;
|
||||
callsArg(index: number): SinonStub;
|
||||
callsArgOn(index: number, context: any): SinonStub;
|
||||
callsArgWith(index: number, ...args: any[]): SinonStub;
|
||||
callsArgOnWith(index: number, context: any, ...args: any[]): SinonStub;
|
||||
callsArgAsync(index: number): SinonStub;
|
||||
callsArgOnAsync(index: number, context: any): SinonStub;
|
||||
callsArgWithAsync(index: number, ...args: any[]): SinonStub;
|
||||
callsArgOnWithAsync(index: number, context: any, ...args: any[]): SinonStub;
|
||||
onCall(n: number): SinonStub;
|
||||
onFirstCall(): SinonStub;
|
||||
onSecondCall(): SinonStub;
|
||||
onThirdCall(): SinonStub;
|
||||
yields(...args: any[]): SinonStub;
|
||||
yieldsOn(context: any, ...args: any[]): SinonStub;
|
||||
yieldsTo(property: string, ...args: any[]): SinonStub;
|
||||
yieldsToOn(property: string, context: any, ...args: any[]): SinonStub;
|
||||
yieldsAsync(...args: any[]): SinonStub;
|
||||
yieldsOnAsync(context: any, ...args: any[]): SinonStub;
|
||||
yieldsToAsync(property: string, ...args: any[]): SinonStub;
|
||||
yieldsToOnAsync(property: string, context: any, ...args: any[]): SinonStub;
|
||||
withArgs(...args: any[]): SinonStub;
|
||||
}
|
||||
|
||||
interface SinonStubStatic {
|
||||
(): SinonStub;
|
||||
(obj: any): SinonStub;
|
||||
(obj: any, method: string): SinonStub;
|
||||
(obj: any, method: string, func: any): SinonStub;
|
||||
}
|
||||
|
||||
interface SinonStatic {
|
||||
stub: SinonStubStatic;
|
||||
}
|
||||
|
||||
interface SinonExpectation extends SinonStub {
|
||||
atLeast(n: number): SinonExpectation;
|
||||
atMost(n: number): SinonExpectation;
|
||||
never(): SinonExpectation;
|
||||
once(): SinonExpectation;
|
||||
twice(): SinonExpectation;
|
||||
thrice(): SinonExpectation;
|
||||
exactly(n: number): SinonExpectation;
|
||||
withArgs(...args: any[]): SinonExpectation;
|
||||
withExactArgs(...args: any[]): SinonExpectation;
|
||||
on(obj: any): SinonExpectation;
|
||||
verify(): SinonExpectation;
|
||||
restore(): void;
|
||||
}
|
||||
|
||||
interface SinonExpectationStatic {
|
||||
create(methodName?: string): SinonExpectation;
|
||||
}
|
||||
|
||||
interface SinonMock {
|
||||
expects(method: string): SinonExpectation;
|
||||
restore(): void;
|
||||
verify(): void;
|
||||
}
|
||||
|
||||
interface SinonMockStatic {
|
||||
(): SinonExpectation;
|
||||
(obj: any): SinonMock;
|
||||
}
|
||||
|
||||
interface SinonStatic {
|
||||
expectation: SinonExpectationStatic;
|
||||
mock: SinonMockStatic;
|
||||
}
|
||||
|
||||
interface SinonFakeTimers {
|
||||
now: number;
|
||||
create(now: number): SinonFakeTimers;
|
||||
setTimeout(callback: (...args: any[]) => void, timeout: number, ...args: any[]): number;
|
||||
clearTimeout(id: number): void;
|
||||
setInterval(callback: (...args: any[]) => void, timeout: number, ...args: any[]): number;
|
||||
clearInterval(id: number): void;
|
||||
tick(ms: number): number;
|
||||
reset(): void;
|
||||
Date(): Date;
|
||||
Date(year: number): Date;
|
||||
Date(year: number, month: number): Date;
|
||||
Date(year: number, month: number, day: number): Date;
|
||||
Date(year: number, month: number, day: number, hour: number): Date;
|
||||
Date(year: number, month: number, day: number, hour: number, minute: number): Date;
|
||||
Date(year: number, month: number, day: number, hour: number, minute: number, second: number): Date;
|
||||
Date(year: number, month: number, day: number, hour: number, minute: number, second: number, ms: number): Date;
|
||||
restore(): void;
|
||||
|
||||
/**
|
||||
* Simulate the user changing the system clock while your program is running. It changes the 'now' timestamp
|
||||
* without affecting timers, intervals or immediates.
|
||||
* @param now The new 'now' in unix milliseconds
|
||||
*/
|
||||
setSystemTime(now: number): void;
|
||||
/**
|
||||
* Simulate the user changing the system clock while your program is running. It changes the 'now' timestamp
|
||||
* without affecting timers, intervals or immediates.
|
||||
* @param now The new 'now' as a JavaScript Date
|
||||
*/
|
||||
setSystemTime(date: Date): void;
|
||||
}
|
||||
|
||||
interface SinonFakeTimersStatic {
|
||||
(): SinonFakeTimers;
|
||||
(...timers: string[]): SinonFakeTimers;
|
||||
(now: number, ...timers: string[]): SinonFakeTimers;
|
||||
}
|
||||
|
||||
interface SinonStatic {
|
||||
useFakeTimers: SinonFakeTimersStatic;
|
||||
clock: SinonFakeTimers;
|
||||
}
|
||||
|
||||
interface SinonFakeUploadProgress {
|
||||
eventListeners: {
|
||||
progress: any[];
|
||||
load: any[];
|
||||
abort: any[];
|
||||
error: any[];
|
||||
};
|
||||
|
||||
addEventListener(event: string, listener: (e: Event) => any): void;
|
||||
removeEventListener(event: string, listener: (e: Event) => any): void;
|
||||
dispatchEvent(event: Event): void;
|
||||
}
|
||||
|
||||
interface SinonFakeXMLHttpRequest {
|
||||
// Properties
|
||||
onCreate: (xhr: SinonFakeXMLHttpRequest) => void;
|
||||
url: string;
|
||||
method: string;
|
||||
requestHeaders: any;
|
||||
requestBody: string;
|
||||
status: number;
|
||||
statusText: string;
|
||||
async: boolean;
|
||||
username: string;
|
||||
password: string;
|
||||
withCredentials: boolean;
|
||||
upload: SinonFakeUploadProgress;
|
||||
responseXML: Document;
|
||||
getResponseHeader(header: string): string;
|
||||
getAllResponseHeaders(): any;
|
||||
|
||||
// Methods
|
||||
restore(): void;
|
||||
useFilters: boolean;
|
||||
addFilter(filter: (method: string, url: string, async: boolean, username: string, password: string) => boolean): void;
|
||||
setResponseHeaders(headers: any): void;
|
||||
setResponseBody(body: string): void;
|
||||
respond(status: number, headers: any, body: string): void;
|
||||
autoRespond(ms: number): void;
|
||||
}
|
||||
|
||||
interface SinonFakeXMLHttpRequestStatic {
|
||||
(): SinonFakeXMLHttpRequest;
|
||||
}
|
||||
|
||||
interface SinonStatic {
|
||||
useFakeXMLHttpRequest: SinonFakeXMLHttpRequestStatic;
|
||||
FakeXMLHttpRequest: SinonFakeXMLHttpRequest;
|
||||
}
|
||||
|
||||
interface SinonFakeServer {
|
||||
// Properties
|
||||
autoRespond: boolean;
|
||||
autoRespondAfter: number;
|
||||
fakeHTTPMethods: boolean;
|
||||
getHTTPMethod: (request: SinonFakeXMLHttpRequest) => string;
|
||||
requests: SinonFakeXMLHttpRequest[];
|
||||
respondImmediately: boolean;
|
||||
|
||||
// Methods
|
||||
respondWith(body: string): void;
|
||||
respondWith(response: any[]): void;
|
||||
respondWith(fn: (xhr: SinonFakeXMLHttpRequest) => void): void;
|
||||
respondWith(url: string, body: string): void;
|
||||
respondWith(url: string, response: any[]): void;
|
||||
respondWith(url: string, fn: (xhr: SinonFakeXMLHttpRequest) => void): void;
|
||||
respondWith(method: string, url: string, body: string): void;
|
||||
respondWith(method: string, url: string, response: any[]): void;
|
||||
respondWith(method: string, url: string, fn: (xhr: SinonFakeXMLHttpRequest) => void): void;
|
||||
respondWith(url: RegExp, body: string): void;
|
||||
respondWith(url: RegExp, response: any[]): void;
|
||||
respondWith(url: RegExp, fn: (xhr: SinonFakeXMLHttpRequest) => void): void;
|
||||
respondWith(method: string, url: RegExp, body: string): void;
|
||||
respondWith(method: string, url: RegExp, response: any[]): void;
|
||||
respondWith(method: string, url: RegExp, fn: (xhr: SinonFakeXMLHttpRequest) => void): void;
|
||||
respond(): void;
|
||||
restore(): void;
|
||||
}
|
||||
|
||||
interface SinonFakeServerStatic {
|
||||
create(): SinonFakeServer;
|
||||
}
|
||||
|
||||
interface SinonStatic {
|
||||
fakeServer: SinonFakeServerStatic;
|
||||
fakeServerWithClock: SinonFakeServerStatic;
|
||||
}
|
||||
|
||||
interface SinonExposeOptions {
|
||||
prefix?: string;
|
||||
includeFail?: boolean;
|
||||
}
|
||||
|
||||
interface SinonAssert {
|
||||
// Properties
|
||||
failException: string;
|
||||
fail: (message?: string) => void; // Overridable
|
||||
pass: (assertion: any) => void; // Overridable
|
||||
|
||||
// Methods
|
||||
notCalled(spy: SinonSpy): void;
|
||||
called(spy: SinonSpy): void;
|
||||
calledOnce(spy: SinonSpy): void;
|
||||
calledTwice(spy: SinonSpy): void;
|
||||
calledThrice(spy: SinonSpy): void;
|
||||
callCount(spy: SinonSpy, count: number): void;
|
||||
callOrder(...spies: SinonSpy[]): void;
|
||||
calledOn(spy: SinonSpy, obj: any): void;
|
||||
alwaysCalledOn(spy: SinonSpy, obj: any): void;
|
||||
calledWith(spy: SinonSpy, ...args: any[]): void;
|
||||
alwaysCalledWith(spy: SinonSpy, ...args: any[]): void;
|
||||
neverCalledWith(spy: SinonSpy, ...args: any[]): void;
|
||||
calledWithExactly(spy: SinonSpy, ...args: any[]): void;
|
||||
alwaysCalledWithExactly(spy: SinonSpy, ...args: any[]): void;
|
||||
calledWithMatch(spy: SinonSpy, ...args: any[]): void;
|
||||
alwaysCalledWithMatch(spy: SinonSpy, ...args: any[]): void;
|
||||
neverCalledWithMatch(spy: SinonSpy, ...args: any[]): void;
|
||||
threw(spy: SinonSpy): void;
|
||||
threw(spy: SinonSpy, exception: string): void;
|
||||
threw(spy: SinonSpy, exception: any): void;
|
||||
alwaysThrew(spy: SinonSpy): void;
|
||||
alwaysThrew(spy: SinonSpy, exception: string): void;
|
||||
alwaysThrew(spy: SinonSpy, exception: any): void;
|
||||
expose(obj: any, options?: SinonExposeOptions): void;
|
||||
}
|
||||
|
||||
interface SinonStatic {
|
||||
assert: SinonAssert;
|
||||
}
|
||||
|
||||
interface SinonMatcher {
|
||||
and(expr: SinonMatcher): SinonMatcher;
|
||||
or(expr: SinonMatcher): SinonMatcher;
|
||||
}
|
||||
|
||||
interface SinonMatch {
|
||||
(value: number): SinonMatcher;
|
||||
(value: string): SinonMatcher;
|
||||
(expr: RegExp): SinonMatcher;
|
||||
(obj: any): SinonMatcher;
|
||||
(callback: (value: any) => boolean): SinonMatcher;
|
||||
any: SinonMatcher;
|
||||
defined: SinonMatcher;
|
||||
truthy: SinonMatcher;
|
||||
falsy: SinonMatcher;
|
||||
bool: SinonMatcher;
|
||||
number: SinonMatcher;
|
||||
string: SinonMatcher;
|
||||
object: SinonMatcher;
|
||||
func: SinonMatcher;
|
||||
array: SinonMatcher;
|
||||
regexp: SinonMatcher;
|
||||
date: SinonMatcher;
|
||||
same(obj: any): SinonMatcher;
|
||||
typeOf(type: string): SinonMatcher;
|
||||
instanceOf(type: any): SinonMatcher;
|
||||
has(property: string, expect?: any): SinonMatcher;
|
||||
hasOwn(property: string, expect?: any): SinonMatcher;
|
||||
}
|
||||
|
||||
interface SinonStatic {
|
||||
match: SinonMatch;
|
||||
}
|
||||
|
||||
interface SinonSandboxConfig {
|
||||
injectInto?: any;
|
||||
properties?: string[];
|
||||
useFakeTimers?: any;
|
||||
useFakeServer?: any;
|
||||
}
|
||||
|
||||
interface SinonSandbox {
|
||||
clock: SinonFakeTimers;
|
||||
requests: SinonFakeXMLHttpRequest;
|
||||
server: SinonFakeServer;
|
||||
spy: SinonSpyStatic;
|
||||
stub: SinonStubStatic;
|
||||
mock: SinonMockStatic;
|
||||
useFakeTimers: SinonFakeTimersStatic;
|
||||
useFakeXMLHttpRequest: SinonFakeXMLHttpRequestStatic;
|
||||
useFakeServer(): SinonFakeServer;
|
||||
restore(): void;
|
||||
}
|
||||
|
||||
interface SinonSandboxStatic {
|
||||
create(): SinonSandbox;
|
||||
create(config: SinonSandboxConfig): SinonSandbox;
|
||||
}
|
||||
|
||||
interface SinonStatic {
|
||||
sandbox: SinonSandboxStatic;
|
||||
}
|
||||
|
||||
interface SinonTestConfig {
|
||||
injectIntoThis?: boolean;
|
||||
injectInto?: any;
|
||||
properties?: string[];
|
||||
useFakeTimers?: boolean;
|
||||
useFakeServer?: boolean;
|
||||
}
|
||||
|
||||
interface SinonTestWrapper extends SinonSandbox {
|
||||
(...args: any[]): any;
|
||||
}
|
||||
|
||||
interface SinonStatic {
|
||||
config: SinonTestConfig;
|
||||
test(fn: (...args: any[]) => any): SinonTestWrapper;
|
||||
testCase(tests: any): any;
|
||||
}
|
||||
|
||||
// Utility overridables
|
||||
interface SinonStatic {
|
||||
createStubInstance(constructor: any): SinonStub;
|
||||
format(obj: any): string;
|
||||
log(message: string): void;
|
||||
restore(object: any): void;
|
||||
}
|
||||
|
||||
|
||||
declare var sinon: SinonStatic;
|
||||
|
||||
declare module "sinon" {
|
||||
export = sinon;
|
||||
}
|
|
@ -1,6 +0,0 @@
|
|||
Checked-in EXEs are required in order to run tests for the Chrome and Internet Explorer browsers
|
||||
through Selenium's WebDriver. These must be copied to the output directory (or otherwise be located
|
||||
somewhere in the global PATH) in order for WebDriver to find them.
|
||||
|
||||
The latest IEDriverServer.exe is published at http://code.google.com/p/selenium/downloads/list
|
||||
The latest ChromeDriver.exe is published at http://chromedriver.storage.googleapis.com/index.html
|
|
@ -1,147 +0,0 @@
|
|||
/// <reference path="../External/qunit.d.ts" />
|
||||
|
||||
/**
|
||||
* Wrapper around QUnit asserts. This class has two purposes:
|
||||
* - Make Assertion methods easy to discover.
|
||||
* - Make them consistent with XUnit assertions in the order of the actual and expected parameter values.
|
||||
*/
|
||||
class Assert {
|
||||
/**
|
||||
* A deep recursive comparison assertion, working on primitive types, arrays, objects,
|
||||
* regular expressions, dates and functions.
|
||||
*
|
||||
* The deepEqual() assertion can be used just like equal() when comparing the value of
|
||||
* objects, such that { key: value } is equal to { key: value }. For non-scalar values,
|
||||
* identity will be disregarded by deepEqual.
|
||||
*
|
||||
* @param expected Known comparison value
|
||||
* @param actual Object or Expression being tested
|
||||
* @param message A short description of the assertion
|
||||
*/
|
||||
public static deepEqual(expected: any, actual: any, message?: string): any {
|
||||
return deepEqual(actual, expected, message);
|
||||
}
|
||||
|
||||
/**
|
||||
* A non-strict comparison assertion, roughly equivalent to JUnit assertEquals.
|
||||
*
|
||||
* The equal assertion uses the simple comparison operator (==) to compare the actual
|
||||
* and expected arguments. When they are equal, the assertion passes: any; otherwise, it fails.
|
||||
* When it fails, both actual and expected values are displayed in the test result,
|
||||
* in addition to a given message.
|
||||
*
|
||||
* @param expected Known comparison value
|
||||
* @param actual Expression being tested
|
||||
* @param message A short description of the assertion
|
||||
*/
|
||||
public static equal(expected: any, actual: any, message?: string): any {
|
||||
return equal(actual, expected, message);
|
||||
}
|
||||
|
||||
/**
|
||||
* An inverted deep recursive comparison assertion, working on primitive types,
|
||||
* arrays, objects, regular expressions, dates and functions.
|
||||
*
|
||||
* The notDeepEqual() assertion can be used just like equal() when comparing the
|
||||
* value of objects, such that { key: value } is equal to { key: value }. For non-scalar
|
||||
* values, identity will be disregarded by notDeepEqual.
|
||||
*
|
||||
* @param expected Known comparison value
|
||||
* @param actual Object or Expression being tested
|
||||
* @param message A short description of the assertion
|
||||
*/
|
||||
public static notDeepEqual(expected: any, actual: any, message?: string): any {
|
||||
return notDeepEqual(actual, expected, message);
|
||||
}
|
||||
|
||||
/**
|
||||
* A non-strict comparison assertion, checking for inequality.
|
||||
*
|
||||
* The notEqual assertion uses the simple inverted comparison operator (!=) to compare
|
||||
* the actual and expected arguments. When they aren't equal, the assertion passes: any;
|
||||
* otherwise, it fails. When it fails, both actual and expected values are displayed
|
||||
* in the test result, in addition to a given message.
|
||||
*
|
||||
* @param expected Known comparison value
|
||||
* @param actual Expression being tested
|
||||
* @param message A short description of the assertion
|
||||
*/
|
||||
public static notEqual(expected: any, actual: any, message?: string): any {
|
||||
return notEqual(actual, expected, message);
|
||||
}
|
||||
|
||||
public static notPropEqual(expected: any, actual: any, message?: string): any {
|
||||
return notPropEqual(actual, expected, message);
|
||||
}
|
||||
|
||||
public static propEqual(expected: any, actual: any, message?: string): any {
|
||||
return propEqual(actual, expected, message);
|
||||
}
|
||||
|
||||
/**
|
||||
* A non-strict comparison assertion, checking for inequality.
|
||||
*
|
||||
* The notStrictEqual assertion uses the strict inverted comparison operator (!==)
|
||||
* to compare the actual and expected arguments. When they aren't equal, the assertion
|
||||
* passes: any; otherwise, it fails. When it fails, both actual and expected values are
|
||||
* displayed in the test result, in addition to a given message.
|
||||
*
|
||||
* @param expected Known comparison value
|
||||
* @param actual Expression being tested
|
||||
* @param message A short description of the assertion
|
||||
*/
|
||||
public static notStrictEqual(expected: any, actual: any, message?: string): any {
|
||||
return notStrictEqual(actual, expected, message);
|
||||
}
|
||||
|
||||
/**
|
||||
* A boolean assertion, equivalent to CommonJS's assert.ok() and JUnit's assertTrue().
|
||||
* Passes if the first argument is truthy.
|
||||
*
|
||||
* The most basic assertion in QUnit, ok() requires just one argument. If the argument
|
||||
* evaluates to true, the assertion passes; otherwise, it fails. If a second message
|
||||
* argument is provided, it will be displayed in place of the result.
|
||||
*
|
||||
* @param state Expression being tested
|
||||
* @param message A short description of the assertion
|
||||
*/
|
||||
public static ok(state: any, message?: string): any {
|
||||
return ok(state, message);
|
||||
}
|
||||
|
||||
/**
|
||||
* A strict type and value comparison assertion.
|
||||
*
|
||||
* The strictEqual() assertion provides the most rigid comparison of type and value with
|
||||
* the strict equality operator (===)
|
||||
*
|
||||
* @param expected Known comparison value
|
||||
* @param actual Expression being tested
|
||||
* @param message A short description of the assertion
|
||||
*/
|
||||
public static strictEqual(expected: any, actual: any, message?: string): any {
|
||||
return strictEqual(actual, expected, message);
|
||||
}
|
||||
|
||||
/**
|
||||
* Assertion to test if a callback throws an exception when run.
|
||||
*
|
||||
* When testing code that is expected to throw an exception based on a specific set of
|
||||
* circumstances, use throws() to catch the error object for testing and comparison.
|
||||
*
|
||||
* @param block Function to execute
|
||||
* @param expected Error Object to compare
|
||||
* @param message A short description of the assertion
|
||||
*/
|
||||
public static throws(block: () => any, expected: any, message?: string): any;
|
||||
|
||||
/**
|
||||
* @param block Function to execute
|
||||
* @param message A short description of the assertion
|
||||
*/
|
||||
public static throws(block: () => any, message?: string): any;
|
||||
|
||||
public static throws(block: () => any, expected?: any, message?: string): any {
|
||||
return throws(block, expected, message);
|
||||
}
|
||||
}
|
|
@ -1,6 +0,0 @@
|
|||
/// <reference path="../External/sinon.d.ts" />
|
||||
/// <reference path="../External/qunit.d.ts" />
|
||||
/// <reference path="Assert.ts" />
|
||||
/// <reference path="PollingAssert.ts" />
|
||||
/// <reference path="TestClass.ts" />
|
||||
/// <reference path="TestCase.ts" />
|
|
@ -1,34 +0,0 @@
|
|||
/// <reference path="../External/qunit.d.ts" />
|
||||
/// <reference path="TestClass.ts" />
|
||||
|
||||
class PollingAssert {
|
||||
/**
|
||||
* Starts polling assertion function for a period of time after which it's considered failed.
|
||||
* @param {() => boolean} assertionFunctionReturnsBoolean - funciton returning true if condition passes and false if condition fails. Assertion will be done on this function's result.
|
||||
* @param {string} assertDescription - message shown with the assertion
|
||||
* @param {number} timeoutSeconds - timeout in seconds after which assertion fails
|
||||
* @param {number} pollIntervalMs - polling interval in milliseconds
|
||||
* @returns {(nextTestStep) => void} callback which will be invoked by the TestClass
|
||||
*/
|
||||
public static createPollingAssert(assertionFunctionReturnsBoolean: () => boolean, assertDescription: string, timeoutSeconds: number = 30, pollIntervalMs: number = 500): (nextTestStep) => void {
|
||||
const pollingAssert = (nextTestStep) => {
|
||||
const timeout = new Date(new Date().getTime() + timeoutSeconds * 1000);
|
||||
const polling = () => {
|
||||
if (assertionFunctionReturnsBoolean.apply(this)) {
|
||||
Assert.ok(true, assertDescription);
|
||||
nextTestStep();
|
||||
} else if (timeout < new Date()) {
|
||||
Assert.ok(false, "assert didn't succeed for " + timeout + " seconds: " + assertDescription);
|
||||
nextTestStep();
|
||||
} else {
|
||||
setTimeout(polling, pollIntervalMs);
|
||||
}
|
||||
}
|
||||
setTimeout(polling, pollIntervalMs);
|
||||
}
|
||||
|
||||
pollingAssert[TestClass.isPollingStepFlag] = true;
|
||||
|
||||
return pollingAssert;
|
||||
}
|
||||
}
|
|
@ -1,22 +0,0 @@
|
|||
|
||||
/** Defines a test case */
|
||||
class TestCase {
|
||||
/** Name to use for the test case */
|
||||
public name: string;
|
||||
|
||||
/** Test case method */
|
||||
public test: () => void;
|
||||
}
|
||||
|
||||
|
||||
/** Defines a test case */
|
||||
interface TestCaseAsync {
|
||||
/** Name to use for the test case */
|
||||
name: string;
|
||||
|
||||
/** time to wait after pre before invoking post and calling start() */
|
||||
stepDelay: number;
|
||||
|
||||
/** async steps */
|
||||
steps: Array<() => void>;
|
||||
}
|
|
@ -1,250 +0,0 @@
|
|||
/// <reference path="../External/sinon.d.ts" />
|
||||
/// <reference path="../External/qunit.d.ts" />
|
||||
/// <reference path="Assert.ts" />
|
||||
/// <reference path="./TestCase.ts"/>
|
||||
|
||||
class TestClass {
|
||||
|
||||
public static isPollingStepFlag = "isPollingStep";
|
||||
|
||||
/** The instance of the currently running suite. */
|
||||
public static currentTestClass: TestClass;
|
||||
|
||||
/** Turns on/off sinon's syncronous implementation of setTimeout. On by default. */
|
||||
public useFakeTimers: boolean = true;
|
||||
|
||||
/** Turns on/off sinon's fake implementation of XMLHttpRequest. On by default. */
|
||||
public useFakeServer: boolean = true;
|
||||
|
||||
constructor(name?: string) {
|
||||
QUnit.module(name);
|
||||
}
|
||||
|
||||
/** Method called before the start of each test method */
|
||||
public testInitialize() {
|
||||
}
|
||||
|
||||
/** Method called after each test method has completed */
|
||||
public testCleanup() {
|
||||
}
|
||||
|
||||
/** Method in which test class intances should call this.testCase(...) to register each of this suite's tests. */
|
||||
public registerTests() {
|
||||
}
|
||||
|
||||
/** Register an async Javascript unit testcase. */
|
||||
public testCaseAsync(testInfo: TestCaseAsync) {
|
||||
if (!testInfo.name) {
|
||||
throw new Error("Must specify name in testInfo context in registerTestcase call");
|
||||
}
|
||||
|
||||
if (isNaN(testInfo.stepDelay)) {
|
||||
throw new Error("Must specify 'stepDelay' period between pre and post");
|
||||
}
|
||||
|
||||
if (!testInfo.steps) {
|
||||
throw new Error("Must specify 'steps' to take asynchronously");
|
||||
}
|
||||
|
||||
// Create a wrapper around the test method so we can do test initilization and cleanup.
|
||||
const testMethod = (assert) => {
|
||||
const done = assert.async();
|
||||
|
||||
// Save off the instance of the currently running suite.
|
||||
TestClass.currentTestClass = this;
|
||||
|
||||
// Run the test.
|
||||
try {
|
||||
this._testStarting();
|
||||
|
||||
const steps = testInfo.steps;
|
||||
const trigger = () => {
|
||||
if (steps.length) {
|
||||
const step = steps.shift();
|
||||
|
||||
// The callback which activates the next test step.
|
||||
const nextTestStepTrigger = () => {
|
||||
setTimeout(() => {
|
||||
trigger();
|
||||
}, testInfo.stepDelay);
|
||||
};
|
||||
|
||||
// There 2 types of test steps - simple and polling.
|
||||
// Upon completion of the simple test step the next test step will be called.
|
||||
// In case of polling test step the next test step is passed to the polling test step, and
|
||||
// it is responsibility of the polling test step to call the next test step.
|
||||
try {
|
||||
if (step[TestClass.isPollingStepFlag]) {
|
||||
step.call(this, nextTestStepTrigger);
|
||||
} else {
|
||||
step.call(this);
|
||||
nextTestStepTrigger.call(this);
|
||||
}
|
||||
} catch (e) {
|
||||
this._testCompleted();
|
||||
Assert.ok(false, e.toString());
|
||||
|
||||
// done is QUnit callback indicating the end of the test
|
||||
done();
|
||||
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
this._testCompleted();
|
||||
|
||||
// done is QUnit callback indicating the end of the test
|
||||
done();
|
||||
}
|
||||
};
|
||||
|
||||
trigger();
|
||||
} catch (ex) {
|
||||
Assert.ok(false, "Unexpected Exception: " + ex);
|
||||
this._testCompleted(true);
|
||||
|
||||
// done is QUnit callback indicating the end of the test
|
||||
done();
|
||||
}
|
||||
};
|
||||
|
||||
// Register the test with QUnit
|
||||
QUnit.test(testInfo.name, testMethod);
|
||||
}
|
||||
|
||||
/** Register a Javascript unit testcase. */
|
||||
public testCase(testInfo: TestCase) {
|
||||
if (!testInfo.name) {
|
||||
throw new Error("Must specify name in testInfo context in registerTestcase call");
|
||||
}
|
||||
|
||||
if (!testInfo.test) {
|
||||
throw new Error("Must specify 'test' method in testInfo context in registerTestcase call");
|
||||
}
|
||||
|
||||
// Create a wrapper around the test method so we can do test initilization and cleanup.
|
||||
const testMethod = () => {
|
||||
// Save off the instance of the currently running suite.
|
||||
TestClass.currentTestClass = this;
|
||||
|
||||
// Run the test.
|
||||
try {
|
||||
this._testStarting();
|
||||
|
||||
testInfo.test.call(this);
|
||||
|
||||
this._testCompleted();
|
||||
}
|
||||
catch (ex) {
|
||||
Assert.ok(false, "Unexpected Exception: " + ex);
|
||||
this._testCompleted(true);
|
||||
}
|
||||
};
|
||||
|
||||
// Register the test with QUnit
|
||||
test(testInfo.name, testMethod);
|
||||
}
|
||||
|
||||
/** Called when the test is starting. */
|
||||
private _testStarting() {
|
||||
// Initialize the sandbox similar to what is done in sinon.js "test()" override. See note on class.
|
||||
const config = (sinon as any).getConfig(sinon.config);
|
||||
config.useFakeTimers = this.useFakeTimers;
|
||||
config.useFakeServer = this.useFakeServer;
|
||||
|
||||
config.injectInto = config.injectIntoThis && this || config.injectInto;
|
||||
this.sandbox = sinon.sandbox.create(config);
|
||||
this.server = this.sandbox.server;
|
||||
|
||||
// Allow the derived class to perform test initialization.
|
||||
this.testInitialize();
|
||||
}
|
||||
|
||||
/** Called when the test is completed. */
|
||||
private _testCompleted(failed?: boolean) {
|
||||
if (failed) {
|
||||
// Just cleanup the sandbox since the test has already failed.
|
||||
this.sandbox.restore();
|
||||
}
|
||||
else {
|
||||
// Verify the sandbox and restore.
|
||||
(this.sandbox as any).verifyAndRestore();
|
||||
}
|
||||
|
||||
this.testCleanup();
|
||||
|
||||
// Clear the instance of the currently running suite.
|
||||
TestClass.currentTestClass = null;
|
||||
}
|
||||
|
||||
/**** Sinon methods and properties ***/
|
||||
|
||||
// These methods and properties are injected by Sinon and will override the implementation here.
|
||||
// These are here purely to make typescript happy.
|
||||
public clock: SinonFakeTimers;
|
||||
public server: SinonFakeServer;
|
||||
public sandbox: SinonSandbox;
|
||||
|
||||
/** Creates an anonymous function that records arguments, this value, exceptions and return values for all calls. */
|
||||
public spy(): SinonSpy;
|
||||
/** Spies on the provided function */
|
||||
public spy(funcToWrap: Function): SinonSpy;
|
||||
/** Creates a spy for object.methodName and replaces the original method with the spy. The spy acts exactly like the original method in all cases. The original method can be restored by calling object.methodName.restore(). The returned spy is the function object which replaced the original method. spy === object.method. */
|
||||
public spy(object: any, methodName: string, func?: Function): SinonSpy;
|
||||
public spy(...args: any[]): SinonSpy { return null; }
|
||||
|
||||
/** Creates an anonymous stub function. */
|
||||
public stub(): SinonStub;
|
||||
/** Stubs all the object's methods. */
|
||||
public stub(object: any): SinonStub;
|
||||
/** Replaces object.methodName with a func, wrapped in a spy. As usual, object.methodName.restore(); can be used to restore the original method. */
|
||||
public stub(object: any, methodName: string, func?: Function): SinonStub;
|
||||
public stub(...args: any[]): SinonStub { return null; }
|
||||
|
||||
/** Creates a mock for the provided object.Does not change the object, but returns a mock object to set expectations on the object's methods. */
|
||||
public mock(object: any): SinonMock { return null; }
|
||||
|
||||
/**** end: Sinon methods and properties ***/
|
||||
|
||||
/** Sends a JSON response to the provided request.
|
||||
* @param request The request to respond to.
|
||||
* @param data Data to respond with.
|
||||
* @param errorCode Optional error code to send with the request, default is 200
|
||||
*/
|
||||
public sendJsonResponse(request: SinonFakeXMLHttpRequest, data: any, errorCode?: number) {
|
||||
if (errorCode === undefined) {
|
||||
errorCode = 200;
|
||||
}
|
||||
|
||||
request.respond(
|
||||
errorCode,
|
||||
{ "Content-Type": "application/json" },
|
||||
JSON.stringify(data));
|
||||
}
|
||||
|
||||
protected setUserAgent(userAgent: string) {
|
||||
Object.defineProperty(window.navigator, 'userAgent',
|
||||
{
|
||||
configurable: true,
|
||||
get: function () {
|
||||
return userAgent;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// Configure Sinon
|
||||
sinon.assert.fail = (msg?) => {
|
||||
Assert.ok(false, msg);
|
||||
};
|
||||
|
||||
sinon.assert.pass = (assertion) => {
|
||||
Assert.ok(assertion, "sinon assert");
|
||||
};
|
||||
|
||||
sinon.config = {
|
||||
injectIntoThis: true,
|
||||
injectInto: null,
|
||||
properties: ["spy", "stub", "mock", "clock", "sandbox"],
|
||||
useFakeTimers: true,
|
||||
useFakeServer: true
|
||||
};
|
|
@ -1,15 +1,13 @@
|
|||
/// <reference path="../TestFramework/TestClass.ts" />
|
||||
|
||||
import { Assert, AITestClass } from "@microsoft/ai-test-framework";
|
||||
import { AppInsightsCore, DiagnosticLogger, ITelemetryItem, objForEachKey } from "@microsoft/applicationinsights-core-js";
|
||||
import { ReactNativePlugin, INativeDevice, IReactNativePluginConfig } from '../../src';
|
||||
import { ReactNativePlugin, INativeDevice, IReactNativePluginConfig } from '../../../src/index';
|
||||
import dynamicProto from '@microsoft/dynamicproto-js';
|
||||
|
||||
export class ReactNativePluginTests extends TestClass {
|
||||
export class ReactNativePluginTests extends AITestClass {
|
||||
private plugin: ReactNativePlugin;
|
||||
private core: AppInsightsCore;
|
||||
private config: IReactNativePluginConfig;
|
||||
private item: ITelemetryItem;
|
||||
private _dynProtoOpts: any = null;
|
||||
|
||||
public testInitialize() {
|
||||
this._disableDynProtoBaseFuncs();
|
||||
|
@ -99,8 +97,8 @@ export class ReactNativePluginTests extends TestClass {
|
|||
this.testCase({
|
||||
name: 'Autocollection is enabled by default',
|
||||
test: () => {
|
||||
const autoCollectStub = this.sandbox.stub(this.plugin, '_collectDeviceInfo');
|
||||
const autoCollectExceptionStub = this.sandbox.stub(this.plugin, '_setExceptionHandler', () => true);
|
||||
const autoCollectStub = this.sandbox.stub(this.plugin as any, '_collectDeviceInfo');
|
||||
const autoCollectExceptionStub = this.sandbox.stub(this.plugin as any, '_setExceptionHandler').callsFake(() => true);
|
||||
|
||||
this.plugin.initialize(this.config, this.core, []);
|
||||
Assert.equal(false, this.plugin['_config'].disableDeviceCollection, 'disableDeviceCollection is false');
|
||||
|
@ -113,8 +111,8 @@ export class ReactNativePluginTests extends TestClass {
|
|||
this.testCase({
|
||||
name: 'Autocollection does not run when disabled from root config',
|
||||
test: () => {
|
||||
const autoCollectStub = this.sandbox.stub(this.plugin, '_collectDeviceInfo');
|
||||
const autoCollectExceptionStub = this.sandbox.stub(this.plugin, '_setExceptionHandler', () => true);
|
||||
const autoCollectStub = this.sandbox.stub(this.plugin as any, '_collectDeviceInfo');
|
||||
const autoCollectExceptionStub = this.sandbox.stub(this.plugin as any, '_setExceptionHandler').callsFake(() => true);
|
||||
this.config['disableDeviceCollection'] = true;
|
||||
this.config['disableExceptionCollection'] = true;
|
||||
this.plugin.initialize(this.config, this.core, []);
|
||||
|
@ -130,8 +128,8 @@ export class ReactNativePluginTests extends TestClass {
|
|||
name: 'Autocollection does not run when disabled from constructor config',
|
||||
test: () => {
|
||||
this.plugin = new ReactNativePlugin({disableDeviceCollection: true, disableExceptionCollection: true});
|
||||
const autoCollectStub = this.sandbox.stub(this.plugin, '_collectDeviceInfo');
|
||||
const autoCollectExceptionStub = this.sandbox.stub(this.plugin, '_setExceptionHandler', () => true);
|
||||
const autoCollectStub = this.sandbox.stub(this.plugin as any, '_collectDeviceInfo');
|
||||
const autoCollectExceptionStub = this.sandbox.stub(this.plugin as any, '_setExceptionHandler').callsFake(() => true);
|
||||
this.plugin.initialize(this.config, this.core, []);
|
||||
|
||||
Assert.equal(true, this.plugin['_config'].disableDeviceCollection, 'disableDeviceCollection is true');
|
||||
|
@ -145,8 +143,8 @@ export class ReactNativePluginTests extends TestClass {
|
|||
name: 'Autocollection runs when empty config is passed',
|
||||
test: () => {
|
||||
this.plugin = new ReactNativePlugin({} as any);
|
||||
const autoCollectStub = this.sandbox.stub(this.plugin, '_collectDeviceInfo');
|
||||
const autoCollectExceptionStub = this.sandbox.stub(this.plugin, '_setExceptionHandler', () => true);
|
||||
const autoCollectStub = this.sandbox.stub(this.plugin as any, '_collectDeviceInfo');
|
||||
const autoCollectExceptionStub = this.sandbox.stub(this.plugin as any, '_setExceptionHandler').callsFake(() => true);
|
||||
this.plugin.initialize(this.config, this.core, []);
|
||||
|
||||
Assert.equal(false, this.plugin['_config'].disableDeviceCollection, 'disableDeviceCollection is false');
|
||||
|
@ -160,8 +158,8 @@ export class ReactNativePluginTests extends TestClass {
|
|||
name: 'Autocollection runs when random config is passed',
|
||||
test: () => {
|
||||
this.plugin = new ReactNativePlugin({foo: 'bar'} as any);
|
||||
const autoCollectStub = this.sandbox.stub(this.plugin, '_collectDeviceInfo');
|
||||
const autoCollectExceptionStub = this.sandbox.stub(this.plugin, '_setExceptionHandler', () => true);
|
||||
const autoCollectStub = this.sandbox.stub(this.plugin as any, '_collectDeviceInfo');
|
||||
const autoCollectExceptionStub = this.sandbox.stub(this.plugin as any, '_setExceptionHandler').callsFake(() => true);
|
||||
this.plugin.initialize(this.config, this.core, []);
|
||||
|
||||
Assert.deepEqual(false, this.plugin['_config'].disableDeviceCollection, 'disableDeviceCollection is false');
|
||||
|
@ -175,21 +173,6 @@ export class ReactNativePluginTests extends TestClass {
|
|||
private _getDevice(plugin: any): any {
|
||||
return plugin._getDbgPlgTargets()[0];
|
||||
}
|
||||
|
||||
protected _disableDynProtoBaseFuncs() {
|
||||
let defOpts = dynamicProto['_dfOpts'];
|
||||
if (defOpts) {
|
||||
if (!this._dynProtoOpts) {
|
||||
// Save the current settings so we can restore them
|
||||
this._dynProtoOpts = {};
|
||||
Object.keys(defOpts).forEach((key) => {
|
||||
this._dynProtoOpts[key] = defOpts[key];
|
||||
});
|
||||
}
|
||||
|
||||
defOpts.useBaseInst = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export function runTests() {
|
|
@ -8,12 +8,12 @@
|
|||
<link rel="stylesheet" href="https://code.jquery.com/qunit/qunit-1.23.1.css">
|
||||
<script src="http://sinonjs.org/releases/sinon-2.3.8.js"></script>
|
||||
<script src="http://cdnjs.cloudflare.com/ajax/libs/require.js/2.2.0/require.js"></script>
|
||||
<script src="../../../../common/Tests/Selenium/ModuleLoader.js"></script>
|
||||
<script src="../../../../common/Tests/Selenium/SimpleSyncPromise.js"></script>
|
||||
<script src="../../../common/Tests/Selenium/ModuleLoader.js"></script>
|
||||
<script src="../../../common/Tests/Selenium/SimpleSyncPromise.js"></script>
|
||||
|
||||
<script>
|
||||
var modules = new ModuleLoader({
|
||||
baseUrl: '../../',
|
||||
baseUrl: '../',
|
||||
paths: {
|
||||
qunit: "../../common/Tests/External/qunit-1.23.1",
|
||||
"react-native": "./Tests/External/DummyReactNative"
|
||||
|
@ -23,6 +23,9 @@
|
|||
// Load qunit here instead of with tests, otherwise will not work
|
||||
modules.add("qunit");
|
||||
|
||||
// Load and define the app insights test framework module
|
||||
modules.add("@microsoft/ai-test-framework", "./node_modules/@microsoft/ai-test-framework/dist/ai-test-framework");
|
||||
|
||||
// Load and define the app insights Shims module
|
||||
modules.add("@microsoft/applicationinsights-shims", "./node_modules/@microsoft/applicationinsights-shims/browser/applicationinsights-shims");
|
||||
|
||||
|
@ -40,7 +43,7 @@
|
|||
// Load React native device info
|
||||
modules.add("react-native-device-info", "./node_modules/react-native-device-info/lib/commonjs/web/index");
|
||||
|
||||
var testModule = modules.add("Tests/Selenium/reactnativeplugin.tests", "./reactnativeplugin.tests.js")
|
||||
var testModule = modules.add("Tests/Unit/src/reactnativeplugin.tests", "./Unit/dist/reactnativeplugin.tests.js")
|
||||
testModule.run = function (tests) {
|
||||
console && console.log("Starting tests");
|
||||
QUnit.start();
|
|
@ -10,5 +10,6 @@
|
|||
"declaration": true,
|
||||
"outFile": "./Selenium/reactnativeplugin.tests.js"
|
||||
},
|
||||
"include": ["Selenium/**/*.ts"],
|
||||
"include": [
|
||||
]
|
||||
}
|
|
@ -0,0 +1,361 @@
|
|||
/**
|
||||
* Config file for API Extractor. For more info, please visit: https://api-extractor.com
|
||||
*/
|
||||
{
|
||||
"$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
|
||||
|
||||
/**
|
||||
* Optionally specifies another JSON config file that this file extends from. This provides a way for
|
||||
* standard settings to be shared across multiple projects.
|
||||
*
|
||||
* If the path starts with "./" or "../", the path is resolved relative to the folder of the file that contains
|
||||
* the "extends" field. Otherwise, the first path segment is interpreted as an NPM package name, and will be
|
||||
* resolved using NodeJS require().
|
||||
*
|
||||
* SUPPORTED TOKENS: none
|
||||
* DEFAULT VALUE: ""
|
||||
*/
|
||||
// "extends": "./shared/api-extractor-base.json"
|
||||
// "extends": "my-package/include/api-extractor-base.json"
|
||||
|
||||
/**
|
||||
* Determines the "<projectFolder>" token that can be used with other config file settings. The project folder
|
||||
* typically contains the tsconfig.json and package.json config files, but the path is user-defined.
|
||||
*
|
||||
* The path is resolved relative to the folder of the config file that contains the setting.
|
||||
*
|
||||
* The default value for "projectFolder" is the token "<lookup>", which means the folder is determined by traversing
|
||||
* parent folders, starting from the folder containing api-extractor.json, and stopping at the first folder
|
||||
* that contains a tsconfig.json file. If a tsconfig.json file cannot be found in this way, then an error
|
||||
* will be reported.
|
||||
*
|
||||
* SUPPORTED TOKENS: <lookup>
|
||||
* DEFAULT VALUE: "<lookup>"
|
||||
*/
|
||||
"projectFolder": ".",
|
||||
|
||||
/**
|
||||
* (REQUIRED) Specifies the .d.ts file to be used as the starting point for analysis. API Extractor
|
||||
* analyzes the symbols exported by this module.
|
||||
*
|
||||
* The file extension must be ".d.ts" and not ".ts".
|
||||
*
|
||||
* The path is resolved relative to the folder of the config file that contains the setting; to change this,
|
||||
* prepend a folder token such as "<projectFolder>".
|
||||
*
|
||||
* SUPPORTED TOKENS: <projectFolder>, <packageName>, <unscopedPackageName>
|
||||
*/
|
||||
"mainEntryPointFilePath": "<projectFolder>/types/index.d.ts",
|
||||
|
||||
/**
|
||||
* A list of NPM package names whose exports should be treated as part of this package.
|
||||
*
|
||||
* For example, suppose that Webpack is used to generate a distributed bundle for the project "library1",
|
||||
* and another NPM package "library2" is embedded in this bundle. Some types from library2 may become part
|
||||
* of the exported API for library1, but by default API Extractor would generate a .d.ts rollup that explicitly
|
||||
* imports library2. To avoid this, we can specify:
|
||||
*
|
||||
* "bundledPackages": [ "library2" ],
|
||||
*
|
||||
* This would direct API Extractor to embed those types directly in the .d.ts rollup, as if they had been
|
||||
* local files for library1.
|
||||
*/
|
||||
"bundledPackages": [
|
||||
],
|
||||
|
||||
/**
|
||||
* Determines how the TypeScript compiler engine will be invoked by API Extractor.
|
||||
*/
|
||||
"compiler": {
|
||||
/**
|
||||
* Specifies the path to the tsconfig.json file to be used by API Extractor when analyzing the project.
|
||||
*
|
||||
* The path is resolved relative to the folder of the config file that contains the setting; to change this,
|
||||
* prepend a folder token such as "<projectFolder>".
|
||||
*
|
||||
* Note: This setting will be ignored if "overrideTsconfig" is used.
|
||||
*
|
||||
* SUPPORTED TOKENS: <projectFolder>, <packageName>, <unscopedPackageName>
|
||||
* DEFAULT VALUE: "<projectFolder>/tsconfig.json"
|
||||
*/
|
||||
// "tsconfigFilePath": "<projectFolder>/tsconfig.json",
|
||||
|
||||
/**
|
||||
* Provides a compiler configuration that will be used instead of reading the tsconfig.json file from disk.
|
||||
* The object must conform to the TypeScript tsconfig schema:
|
||||
*
|
||||
* http://json.schemastore.org/tsconfig
|
||||
*
|
||||
* If omitted, then the tsconfig.json file will be read from the "projectFolder".
|
||||
*
|
||||
* DEFAULT VALUE: no overrideTsconfig section
|
||||
*/
|
||||
// "overrideTsconfig": {
|
||||
// . . .
|
||||
// }
|
||||
|
||||
/**
|
||||
* This option causes the compiler to be invoked with the --skipLibCheck option. This option is not recommended
|
||||
* and may cause API Extractor to produce incomplete or incorrect declarations, but it may be required when
|
||||
* dependencies contain declarations that are incompatible with the TypeScript engine that API Extractor uses
|
||||
* for its analysis. Where possible, the underlying issue should be fixed rather than relying on skipLibCheck.
|
||||
*
|
||||
* DEFAULT VALUE: false
|
||||
*/
|
||||
// "skipLibCheck": true,
|
||||
},
|
||||
|
||||
/**
|
||||
* Configures how the API report file (*.api.md) will be generated.
|
||||
*/
|
||||
"apiReport": {
|
||||
/**
|
||||
* (REQUIRED) Whether to generate an API report.
|
||||
*/
|
||||
"enabled": true,
|
||||
|
||||
/**
|
||||
* The filename for the API report files. It will be combined with "reportFolder" or "reportTempFolder" to produce
|
||||
* a full file path.
|
||||
*
|
||||
* The file extension should be ".api.md", and the string should not contain a path separator such as "\" or "/".
|
||||
*
|
||||
* SUPPORTED TOKENS: <packageName>, <unscopedPackageName>
|
||||
* DEFAULT VALUE: "<unscopedPackageName>.api.md"
|
||||
*/
|
||||
"reportFileName": "<unscopedPackageName>.api.md",
|
||||
|
||||
/**
|
||||
* Specifies the folder where the API report file is written. The file name portion is determined by
|
||||
* the "reportFileName" setting.
|
||||
*
|
||||
* The API report file is normally tracked by Git. Changes to it can be used to trigger a branch policy,
|
||||
* e.g. for an API review.
|
||||
*
|
||||
* The path is resolved relative to the folder of the config file that contains the setting; to change this,
|
||||
* prepend a folder token such as "<projectFolder>".
|
||||
*
|
||||
* SUPPORTED TOKENS: <projectFolder>, <packageName>, <unscopedPackageName>
|
||||
* DEFAULT VALUE: "<projectFolder>/etc/"
|
||||
*/
|
||||
"reportFolder": "<projectFolder>/dist/",
|
||||
|
||||
/**
|
||||
* Specifies the folder where the temporary report file is written. The file name portion is determined by
|
||||
* the "reportFileName" setting.
|
||||
*
|
||||
* After the temporary file is written to disk, it is compared with the file in the "reportFolder".
|
||||
* If they are different, a production build will fail.
|
||||
*
|
||||
* The path is resolved relative to the folder of the config file that contains the setting; to change this,
|
||||
* prepend a folder token such as "<projectFolder>".
|
||||
*
|
||||
* SUPPORTED TOKENS: <projectFolder>, <packageName>, <unscopedPackageName>
|
||||
* DEFAULT VALUE: "<projectFolder>/temp/"
|
||||
*/
|
||||
// "reportTempFolder": "<projectFolder>/temp/"
|
||||
},
|
||||
|
||||
/**
|
||||
* Configures how the doc model file (*.api.json) will be generated.
|
||||
*/
|
||||
"docModel": {
|
||||
/**
|
||||
* (REQUIRED) Whether to generate a doc model file.
|
||||
*/
|
||||
"enabled": true,
|
||||
|
||||
/**
|
||||
* The output path for the doc model file. The file extension should be ".api.json".
|
||||
*
|
||||
* The path is resolved relative to the folder of the config file that contains the setting; to change this,
|
||||
* prepend a folder token such as "<projectFolder>".
|
||||
*
|
||||
* SUPPORTED TOKENS: <projectFolder>, <packageName>, <unscopedPackageName>
|
||||
* DEFAULT VALUE: "<projectFolder>/temp/<unscopedPackageName>.api.json"
|
||||
*/
|
||||
"apiJsonFilePath": "<projectFolder>/dist/<unscopedPackageName>.api.json"
|
||||
},
|
||||
|
||||
/**
|
||||
* Configures how the .d.ts rollup file will be generated.
|
||||
*/
|
||||
"dtsRollup": {
|
||||
/**
|
||||
* (REQUIRED) Whether to generate the .d.ts rollup file.
|
||||
*/
|
||||
"enabled": true,
|
||||
|
||||
/**
|
||||
* Specifies the output path for a .d.ts rollup file to be generated without any trimming.
|
||||
* This file will include all declarations that are exported by the main entry point.
|
||||
*
|
||||
* If the path is an empty string, then this file will not be written.
|
||||
*
|
||||
* The path is resolved relative to the folder of the config file that contains the setting; to change this,
|
||||
* prepend a folder token such as "<projectFolder>".
|
||||
*
|
||||
* SUPPORTED TOKENS: <projectFolder>, <packageName>, <unscopedPackageName>
|
||||
* DEFAULT VALUE: "<projectFolder>/dist/<unscopedPackageName>.d.ts"
|
||||
*/
|
||||
"untrimmedFilePath": "<projectFolder>/dist/<unscopedPackageName>.d.ts",
|
||||
|
||||
/**
|
||||
* Specifies the output path for a .d.ts rollup file to be generated with trimming for a "beta" release.
|
||||
* This file will include only declarations that are marked as "@public" or "@beta".
|
||||
*
|
||||
* The path is resolved relative to the folder of the config file that contains the setting; to change this,
|
||||
* prepend a folder token such as "<projectFolder>".
|
||||
*
|
||||
* SUPPORTED TOKENS: <projectFolder>, <packageName>, <unscopedPackageName>
|
||||
* DEFAULT VALUE: ""
|
||||
*/
|
||||
// "betaTrimmedFilePath": "<projectFolder>/dist/<unscopedPackageName>-beta.d.ts",
|
||||
|
||||
|
||||
/**
|
||||
* Specifies the output path for a .d.ts rollup file to be generated with trimming for a "public" release.
|
||||
* This file will include only declarations that are marked as "@public".
|
||||
*
|
||||
* If the path is an empty string, then this file will not be written.
|
||||
*
|
||||
* The path is resolved relative to the folder of the config file that contains the setting; to change this,
|
||||
* prepend a folder token such as "<projectFolder>".
|
||||
*
|
||||
* SUPPORTED TOKENS: <projectFolder>, <packageName>, <unscopedPackageName>
|
||||
* DEFAULT VALUE: ""
|
||||
*/
|
||||
// "publicTrimmedFilePath": "<projectFolder>/dist/<unscopedPackageName>-public.d.ts",
|
||||
|
||||
/**
|
||||
* When a declaration is trimmed, by default it will be replaced by a code comment such as
|
||||
* "Excluded from this release type: exampleMember". Set "omitTrimmingComments" to true to remove the
|
||||
* declaration completely.
|
||||
*
|
||||
* DEFAULT VALUE: false
|
||||
*/
|
||||
// "omitTrimmingComments": true
|
||||
},
|
||||
|
||||
/**
|
||||
* Configures how the tsdoc-metadata.json file will be generated.
|
||||
*/
|
||||
"tsdocMetadata": {
|
||||
/**
|
||||
* Whether to generate the tsdoc-metadata.json file.
|
||||
*
|
||||
* DEFAULT VALUE: true
|
||||
*/
|
||||
// "enabled": true,
|
||||
|
||||
/**
|
||||
* Specifies where the TSDoc metadata file should be written.
|
||||
*
|
||||
* The path is resolved relative to the folder of the config file that contains the setting; to change this,
|
||||
* prepend a folder token such as "<projectFolder>".
|
||||
*
|
||||
* The default value is "<lookup>", which causes the path to be automatically inferred from the "tsdocMetadata",
|
||||
* "typings" or "main" fields of the project's package.json. If none of these fields are set, the lookup
|
||||
* falls back to "tsdoc-metadata.json" in the package folder.
|
||||
*
|
||||
* SUPPORTED TOKENS: <projectFolder>, <packageName>, <unscopedPackageName>
|
||||
* DEFAULT VALUE: "<lookup>"
|
||||
*/
|
||||
// "tsdocMetadataFilePath": "<projectFolder>/dist/tsdoc-metadata.json"
|
||||
},
|
||||
|
||||
/**
|
||||
* Configures how API Extractor reports error and warning messages produced during analysis.
|
||||
*
|
||||
* There are three sources of messages: compiler messages, API Extractor messages, and TSDoc messages.
|
||||
*/
|
||||
"messages": {
|
||||
/**
|
||||
* Configures handling of diagnostic messages reported by the TypeScript compiler engine while analyzing
|
||||
* the input .d.ts files.
|
||||
*
|
||||
* TypeScript message identifiers start with "TS" followed by an integer. For example: "TS2551"
|
||||
*
|
||||
* DEFAULT VALUE: A single "default" entry with logLevel=warning.
|
||||
*/
|
||||
"compilerMessageReporting": {
|
||||
/**
|
||||
* Configures the default routing for messages that don't match an explicit rule in this table.
|
||||
*/
|
||||
"default": {
|
||||
/**
|
||||
* Specifies whether the message should be written to the the tool's output log. Note that
|
||||
* the "addToApiReportFile" property may supersede this option.
|
||||
*
|
||||
* Possible values: "error", "warning", "none"
|
||||
*
|
||||
* Errors cause the build to fail and return a nonzero exit code. Warnings cause a production build fail
|
||||
* and return a nonzero exit code. For a non-production build (e.g. when "api-extractor run" includes
|
||||
* the "--local" option), the warning is displayed but the build will not fail.
|
||||
*
|
||||
* DEFAULT VALUE: "warning"
|
||||
*/
|
||||
"logLevel": "warning",
|
||||
|
||||
/**
|
||||
* When addToApiReportFile is true: If API Extractor is configured to write an API report file (.api.md),
|
||||
* then the message will be written inside that file; otherwise, the message is instead logged according to
|
||||
* the "logLevel" option.
|
||||
*
|
||||
* DEFAULT VALUE: false
|
||||
*/
|
||||
// "addToApiReportFile": false
|
||||
},
|
||||
|
||||
// "TS2551": {
|
||||
// "logLevel": "warning",
|
||||
// "addToApiReportFile": true
|
||||
// },
|
||||
//
|
||||
// . . .
|
||||
},
|
||||
|
||||
/**
|
||||
* Configures handling of messages reported by API Extractor during its analysis.
|
||||
*
|
||||
* API Extractor message identifiers start with "ae-". For example: "ae-extra-release-tag"
|
||||
*
|
||||
* DEFAULT VALUE: See api-extractor-defaults.json for the complete table of extractorMessageReporting mappings
|
||||
*/
|
||||
"extractorMessageReporting": {
|
||||
"default": {
|
||||
"logLevel": "warning",
|
||||
// "addToApiReportFile": false
|
||||
},
|
||||
|
||||
"ae-missing-release-tag": {
|
||||
"logLevel": "none"
|
||||
},
|
||||
//
|
||||
// . . .
|
||||
},
|
||||
|
||||
/**
|
||||
* Configures handling of messages reported by the TSDoc parser when analyzing code comments.
|
||||
*
|
||||
* TSDoc message identifiers start with "tsdoc-". For example: "tsdoc-link-tag-unescaped-text"
|
||||
*
|
||||
* DEFAULT VALUE: A single "default" entry with logLevel=warning.
|
||||
*/
|
||||
"tsdocMessageReporting": {
|
||||
"default": {
|
||||
"logLevel": "warning",
|
||||
// "addToApiReportFile": false
|
||||
}
|
||||
|
||||
// "tsdoc-link-tag-unescaped-text": {
|
||||
// "logLevel": "warning",
|
||||
// "addToApiReportFile": true
|
||||
// },
|
||||
//
|
||||
// . . .
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -3,33 +3,43 @@
|
|||
"version": "2.3.5",
|
||||
"description": "Microsoft Application Insights React Native Plugin",
|
||||
"main": "dist-esm/index.js",
|
||||
"types": "dist-esm/index.d.ts",
|
||||
"types": "types/index.d.ts",
|
||||
"sideEffects": false,
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/microsoft/ApplicationInsights-JS/tree/master/extensions/applicationinsights-react-native"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "npm run build:esm && npm run build:package",
|
||||
"build:esm": "tsc -p tsconfig.json",
|
||||
"build:test": "tsc -p Tests/tsconfig.json",
|
||||
"build": "npm run build:esm && npm run build:package && npm run dtsgen",
|
||||
"build:esm": "grunt reactnative",
|
||||
"build:package": "rollup -c",
|
||||
"test": "npm run build:test && grunt reactnativetests",
|
||||
"lint": "tslint -p tsconfig.json"
|
||||
"rebuild": "npm run build",
|
||||
"test": "grunt reactnativetests",
|
||||
"testx": "npm run build:test && grunt reactnativetests",
|
||||
"lint": "tslint -p tsconfig.json",
|
||||
"dtsgen": "api-extractor run --local && node ../../scripts/dtsgen.js \"Microsoft Application Insights react native plugin\""
|
||||
},
|
||||
"devDependencies": {
|
||||
"@microsoft/ai-test-framework": "0.0.1",
|
||||
"@microsoft/applicationinsights-rollup-es3": "1.1.3",
|
||||
"@microsoft/api-extractor": "^7.9.11",
|
||||
"@microsoft/api-extractor": "^7.18.1",
|
||||
"grunt": "^1.4.1",
|
||||
"grunt-cli": "^1.4.3",
|
||||
"grunt-contrib-qunit": "^5.0.1",
|
||||
"grunt-contrib-uglify": "^5.0.1",
|
||||
"grunt-run": "^0.8.1",
|
||||
"@nevware21/grunt-ts-plugin": "^0.4.3",
|
||||
"grunt-tslint": "^5.0.2",
|
||||
"@nevware21/grunt-eslint-ts": "^0.2.1",
|
||||
"@typescript-eslint/eslint-plugin": "^4.28.0",
|
||||
"@typescript-eslint/parser": "^4.28.0",
|
||||
"eslint": "^7.29.0",
|
||||
"eslint-config-standard": "^16.0.3",
|
||||
"eslint-plugin-import": "^2.23.4",
|
||||
"eslint-plugin-node": "^11.1.0",
|
||||
"eslint-plugin-promise": "^5.1.0",
|
||||
"qunit": "^2.11.2",
|
||||
"react": "16.13.1",
|
||||
"react-native": "0.64.2",
|
||||
"react": "^17.0.1",
|
||||
"react-native": "^0.64.2",
|
||||
"react-native-device-info": "^5.6.5",
|
||||
"globby": "^11.0.0",
|
||||
"magic-string": "^0.25.7",
|
||||
|
@ -39,19 +49,18 @@
|
|||
"rollup-plugin-cleanup": "3.2.1",
|
||||
"rollup-plugin-peer-deps-external": "^2.2.4",
|
||||
"rollup": "^2.32.0",
|
||||
"tslint": "^5.19.0",
|
||||
"tslint-config-prettier": "^1.18.0",
|
||||
"typescript": "^3.9.7",
|
||||
"typescript": "^4.3.4",
|
||||
"tslib": "^2.0.0",
|
||||
"uglify-js": "^3.11.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"@microsoft/applicationinsights-common": "^2.6.5",
|
||||
"@microsoft/applicationinsights-core-js": "^2.6.5",
|
||||
"@microsoft/applicationinsights-shims": "^2.0.0",
|
||||
"@microsoft/applicationinsights-common": "2.6.5",
|
||||
"@microsoft/applicationinsights-core-js": "2.6.5",
|
||||
"@microsoft/applicationinsights-shims": "2.0.0",
|
||||
"@microsoft/dynamicproto-js": "^1.1.4"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"tslib": "*",
|
||||
"react-native": "*",
|
||||
"react-native-device-info": "^5.2.1"
|
||||
},
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
"noImplicitAny": false,
|
||||
"module": "es6",
|
||||
"moduleResolution": "Node",
|
||||
"target": "es3",
|
||||
"target": "es5",
|
||||
"alwaysStrict": true,
|
||||
"suppressImplicitAnyIndexErrors": true,
|
||||
"allowSyntheticDefaultImports": true,
|
||||
|
@ -13,9 +13,9 @@
|
|||
"noEmitHelpers": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"declaration": true,
|
||||
"declarationDir": "dist-esm",
|
||||
"declarationDir": "extensions/applicationinsights-react-native/types",
|
||||
"outDir": "dist-esm",
|
||||
"rootDir": "src"
|
||||
"rootDir": "extensions/applicationinsights-react-native/src"
|
||||
},
|
||||
"include": [
|
||||
"./src/**/*.ts"
|
||||
|
|
931
gruntfile.js
931
gruntfile.js
|
@ -1,420 +1,535 @@
|
|||
module.exports = function (grunt) {
|
||||
grunt.initConfig({
|
||||
tslint: {
|
||||
options: {
|
||||
rulesDirectory: 'node_modules/tslint-microsoft-contrib',
|
||||
},
|
||||
files: {
|
||||
src: [
|
||||
'./shared/AppInsightsCommon/**/*.ts',
|
||||
'./extensions/**/*.ts',
|
||||
'./AISKU/**/*.ts',
|
||||
'!./**/node_modules/**',
|
||||
'!./**/Tests/**',
|
||||
'!./**/dist-esm/**',
|
||||
'!./**/Generated/**',
|
||||
'./legacy/JavaScript/**/*.ts',
|
||||
'!./legacy/JavaScript/JavaScriptSDK.Tests/**'
|
||||
],
|
||||
function deepMerge(target, src) {
|
||||
try {
|
||||
var newValue = Object.assign({}, target, src);
|
||||
|
||||
if (target && src) {
|
||||
Object.keys(target).forEach((key) => {
|
||||
// Any existing src[key] value would have been assigned over the target[key] version
|
||||
if (src[key] !== undefined) {
|
||||
if (Array.isArray(newValue[key])) {
|
||||
target[key].forEach((value) => {
|
||||
newValue[key].push(value);
|
||||
});
|
||||
} else if (typeof newValue[key] === "object") {
|
||||
// Make sure we merge all properties
|
||||
newValue[key] = deepMerge(newValue[key], target[key]);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
ts: {
|
||||
options: {
|
||||
comments: true,
|
||||
debug: true
|
||||
},
|
||||
default: {
|
||||
tsconfig: './tsconfig.json',
|
||||
},
|
||||
core: {
|
||||
tsconfig: './shared/AppInsightsCore/tsconfig.json'
|
||||
},
|
||||
coreunittest: {
|
||||
tsconfig: './shared/AppInsightsCore/Tests/tsconfig.json',
|
||||
src: [
|
||||
'./shared/AppInsightsCore/Tests/Unit/src/**/*.ts'
|
||||
],
|
||||
out: 'shared/AppInsightsCore/Tests/Unit/dist/aicoreunit.tests.js'
|
||||
},
|
||||
coreperftest: {
|
||||
tsconfig: './shared/AppInsightsCore/Tests/tsconfig.json',
|
||||
src: [
|
||||
'./shared/AppInsightsCore/Tests/Perf/src/**/*.ts'
|
||||
],
|
||||
out: 'shared/AppInsightsCore/Tests/Perf/dist/aicoreperf.tests.js'
|
||||
},
|
||||
common: {
|
||||
tsconfig: './shared/AppInsightsCommon/tsconfig.json'
|
||||
},
|
||||
commonunittest: {
|
||||
tsconfig: './shared/AppInsightsCommon/Tests/tsconfig.json',
|
||||
src: [
|
||||
'./shared/AppInsightsCommon/Tests/Unit/src/**/*.ts',
|
||||
],
|
||||
out: 'shared/AppInsightsCommon/Tests/Unit/dist/aicommon.tests.js'
|
||||
},
|
||||
appinsights: {
|
||||
tsconfig: './extensions/applicationinsights-analytics-js/tsconfig.json',
|
||||
},
|
||||
appinsightsunittests: {
|
||||
tsconfig: './extensions/applicationinsights-analytics-js/Tests/tsconfig.json',
|
||||
src: [
|
||||
'./extensions/applicationinsights-analytics-js/Tests/Unit/src/**/*.ts'
|
||||
],
|
||||
out: 'extensions/applicationinsights-analytics-js/Tests/Unit/dist/appinsights-analytics.tests.js'
|
||||
},
|
||||
aisku: {
|
||||
tsconfig: './AISKU/tsconfig.json',
|
||||
src: [
|
||||
'AISKU/src/*.ts'
|
||||
]
|
||||
},
|
||||
aiskulite: {
|
||||
tsconfig: './AISKULight/tsconfig.json',
|
||||
src: [
|
||||
'AISKULight/*.ts'
|
||||
]
|
||||
},
|
||||
aiskutests: {
|
||||
tsconfig: './AISKU/Tests/tsconfig.json',
|
||||
src: [
|
||||
'AISKU/Tests/Selenium/*.ts',
|
||||
'AISKU/Tests/*.ts'
|
||||
],
|
||||
out: 'AISKU/Tests/Selenium/appinsights-sdk.tests.js'
|
||||
},
|
||||
perfmarkmeasure: {
|
||||
tsconfig: './extensions/applicationinsights-perfmarkmeasure-js/tsconfig.json'
|
||||
},
|
||||
properties: {
|
||||
tsconfig: './extensions/applicationinsights-properties-js/tsconfig.json',
|
||||
src: [
|
||||
'./extensions/applicationinsights-properties-js/*.ts',
|
||||
'./extensions/applicationinsights-properties-js/Context/*.ts',
|
||||
'./extensions/applicationinsights-properties-js/Interfaces/Context/*.ts',
|
||||
'./extensions/applicationinsights-properties-js/Interfaces/*.ts'
|
||||
]
|
||||
},
|
||||
clickanalytics: {
|
||||
tsconfig: './extensions/applicationinsights-clickanalytics-js/tsconfig.json',
|
||||
src: [
|
||||
'./extensions/applicationinsights-clickanalytics-js/*.ts',
|
||||
'./extensions/applicationinsights-clickanalytics-js/Interfaces/*.ts'
|
||||
]
|
||||
},
|
||||
clickanalyticstests: {
|
||||
tsconfig: './extensions/applicationinsights-clickanalytics-js/Tests/tsconfig.json',
|
||||
src: [
|
||||
'./extensions/applicationinsights-clickanalytics-js/Tests/Unit/src/**/*.ts'
|
||||
],
|
||||
out: 'extensions/applicationinsights-clickanalytics-js/Tests/Unit/dist/appinsights-clickanalytics.tests.js'
|
||||
},
|
||||
perfmarkmeasureunittests: {
|
||||
tsconfig: './extensions/applicationinsights-perfmarkmeasure-js/Tests/tsconfig.json',
|
||||
src: [ './extensions/applicationinsights-perfmarkmeasure-js/Tests/Unit/src/**/*.ts' ],
|
||||
out: './extensions/applicationinsights-perfmarkmeasure-js/Tests/Unit/dist/appinsights-perfmarkmeasure.tests.js'
|
||||
},
|
||||
propertiesunittests: {
|
||||
tsconfig: './extensions/applicationinsights-properties-js/Tests/tsconfig.json',
|
||||
src: [ './extensions/applicationinsights-properties-js/Tests/Unit/src/**/*.ts' ],
|
||||
out: './extensions/applicationinsights-properties-js/Tests/Unit/dist/prop.tests.js'
|
||||
},
|
||||
reactnative: {
|
||||
tsconfig: './extensions/applicationinsights-react-native/tsconfig.json',
|
||||
src: [
|
||||
'./extensions/applicationinsights-react-native/src/index.ts'
|
||||
]
|
||||
},
|
||||
reactnativetests: {
|
||||
tsconfig: './extensions/applicationinsights-react-native/Tests/tsconfig.json',
|
||||
src: [ './extensions/applicationinsights-react-native/Tests/**/*.ts' ],
|
||||
out: './extensions/applicationinsights-react-native/Tests/Selenium/reactnativeplugin.tests.js'
|
||||
},
|
||||
deps: {
|
||||
tsconfig: './extensions/applicationinsights-dependencies-js/tsconfig.json'
|
||||
},
|
||||
depsunittest: {
|
||||
tsconfig: './extensions/applicationinsights-dependencies-js/Tests/tsconfig.json',
|
||||
src: [
|
||||
'./extensions/applicationinsights-dependencies-js/Tests/Unit/src/**/*.ts'
|
||||
],
|
||||
out: './extensions/applicationinsights-dependencies-js/Tests/Unit/dist/dependencies.tests.js'
|
||||
},
|
||||
debugplugin: {
|
||||
tsconfig: './extensions/applicationinsights-debugplugin-js/tsconfig.json',
|
||||
src: [
|
||||
'./extensions/applicationinsights-debugplugin-js/*.ts',
|
||||
'./extensions/applicationinsights-debugplugin-js/components/*.ts',
|
||||
]
|
||||
},
|
||||
aichannel: {
|
||||
tsconfig: './channels/applicationinsights-channel-js/tsconfig.json'
|
||||
},
|
||||
aichanneltest: {
|
||||
tsconfig: './channels/applicationinsights-channel-js/Tests/tsconfig.json',
|
||||
src: [
|
||||
'./channels/applicationinsights-channel-js/Tests/Unit/src/**/*.ts'
|
||||
],
|
||||
out: './channels/applicationinsights-channel-js/Tests/Unit/dist/aichannel.tests.js'
|
||||
},
|
||||
rollupuglify: {
|
||||
tsconfig: './tools/rollup-plugin-uglify3-js/tsconfig.json',
|
||||
src: [
|
||||
'./tools/rollup-plugin-uglify3-js/src/*.ts',
|
||||
'!node_modules/**'
|
||||
],
|
||||
out: './tools/rollup-plugin-uglify3-js/out/src/uglify3-js.js'
|
||||
},
|
||||
rollupes3: {
|
||||
tsconfig: './tools/rollup-es3/tsconfig.json'
|
||||
},
|
||||
rollupes3test: {
|
||||
tsconfig: './tools/rollup-es3/Tests/tsconfig.json',
|
||||
src: [
|
||||
'./tools/rollup-es3/Tests/Unit/src/**/*.ts'
|
||||
],
|
||||
out: './tools/rollup-es3/Tests/Unit/dist/es3rolluptests.js'
|
||||
},
|
||||
shims: {
|
||||
tsconfig: './tools/shims/tsconfig.json',
|
||||
src: [
|
||||
'./tools/shims/src/*.ts'
|
||||
]
|
||||
},
|
||||
shimstest: {
|
||||
tsconfig: './tools/shims/Tests/tsconfig.json',
|
||||
src: [
|
||||
'./tools/shims/Tests/Unit/src**/*.ts'
|
||||
],
|
||||
out: './tools/shims/Tests/Unit/dist/shimstests.js'
|
||||
},
|
||||
"tst-framework": {
|
||||
tsconfig: './common/Tests/Framework/tsconfig.json',
|
||||
src: [
|
||||
'./common/Tests/Framework/src/*.ts'
|
||||
]
|
||||
},
|
||||
},
|
||||
uglify: {
|
||||
snippetvNext: {
|
||||
files: {
|
||||
'AISKU/snippet/snippet.min.js': ['AISKU/snippet/snippet.js']
|
||||
},
|
||||
|
||||
return newValue;
|
||||
} catch (e) {
|
||||
console.error("stack: '" + e.stack + "', message: '" + e.message + "', name: '" + e.name + "'");
|
||||
}
|
||||
}
|
||||
|
||||
function buildConfig(modules) {
|
||||
var buildCmds = {
|
||||
ts: {
|
||||
options: {
|
||||
sourceMap: false,
|
||||
ie8: true,
|
||||
compress: {
|
||||
passes:3,
|
||||
unsafe: true,
|
||||
comments: true
|
||||
}
|
||||
},
|
||||
"eslint-ts": {
|
||||
options: {
|
||||
debug: true
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
for (var key in modules) {
|
||||
if (modules.hasOwnProperty(key)) {
|
||||
var modulePath = modules[key].path;
|
||||
var moduleCfg = modules[key].cfg;
|
||||
|
||||
if (grunt.file.exists(modulePath + '/src/tsconfig.json')) {
|
||||
// Use the src tsconfig (if available)
|
||||
buildCmds.ts[key] = {
|
||||
'tsconfig': modulePath + "/src/tsconfig.json",
|
||||
};
|
||||
} else if (grunt.file.exists(modulePath + '/tsconfig.json')) {
|
||||
// Otherwise fall back to the root tsconfig (if available)
|
||||
buildCmds.ts[key] = {
|
||||
'tsconfig': modulePath + "/tsconfig.json",
|
||||
};
|
||||
} else {
|
||||
throw new Error("TSConfig not found for [" + key + "]");
|
||||
}
|
||||
|
||||
if (moduleCfg) {
|
||||
buildCmds.ts[key] = Object.assign(buildCmds.ts[key], moduleCfg);
|
||||
}
|
||||
|
||||
// If the tests have their own tsconfig, add that as a new target
|
||||
// if (grunt.file.exists(modulePath + '/test/tsconfig.json')) {
|
||||
// buildCmds.ts[key + '-tests'] = {
|
||||
// 'tsconfig': modulePath + "/test/tsconfig.json",
|
||||
// };
|
||||
// } else if (grunt.file.exists(modulePath + '/tests/tsconfig.json')) {
|
||||
// buildCmds.ts[key + '-tests'] = {
|
||||
// 'tsconfig': modulePath + "/tests/tsconfig.json",
|
||||
// };
|
||||
// }
|
||||
|
||||
let esLintCmd = buildCmds["eslint-ts"];
|
||||
esLintCmd[key + '-lint'] = {
|
||||
options: {
|
||||
tsconfig: modulePath + '/tsconfig.json'
|
||||
}
|
||||
};
|
||||
|
||||
if (moduleCfg) {
|
||||
esLintCmd[key + '-lint'] = Object.assign(buildCmds.ts[key], moduleCfg);
|
||||
}
|
||||
|
||||
esLintCmd[key + '-lint-fix'] = deepMerge({ options: { fix: true } }, esLintCmd[key + '-lint']);
|
||||
}
|
||||
}
|
||||
|
||||
return buildCmds;
|
||||
}
|
||||
|
||||
try {
|
||||
var theBuildConfig = deepMerge(buildConfig({
|
||||
// Shared
|
||||
"core": { path: "./shared/AppInsightsCore" },
|
||||
"common": { path: "./shared/AppInsightsCommon" },
|
||||
|
||||
// SKUs
|
||||
"aisku": { path: "./AISKU",
|
||||
cfg: {
|
||||
src: [
|
||||
"AISKU/src/*.ts"
|
||||
]
|
||||
}
|
||||
},
|
||||
"aiskulite": { path: "./AISKULight",
|
||||
cfg: {
|
||||
src: [
|
||||
"AISKULight/*.ts"
|
||||
]
|
||||
}
|
||||
},
|
||||
|
||||
// Channels
|
||||
"aichannel": { path: "./channels/applicationinsights-channel-js" },
|
||||
|
||||
// Extensions
|
||||
"appinsights": { path: "./extensions/applicationinsights-analytics-js" },
|
||||
"clickanalytics": { path: "./extensions/applicationinsights-clickanalytics-js" },
|
||||
"debugplugin": { path: "./extensions/applicationinsights-debugplugin-js" },
|
||||
"deps": { path: "./extensions/applicationinsights-dependencies-js" },
|
||||
"perfmarkmeasure": { path: "./extensions/applicationinsights-perfmarkmeasure-js" },
|
||||
"properties": { path: "./extensions/applicationinsights-properties-js" },
|
||||
"react": { path: "./extensions/applicationinsights-react-js",
|
||||
cfg: {
|
||||
src: [
|
||||
"./extensions/applicationinsights-react-js/src/index.ts"
|
||||
]
|
||||
}
|
||||
},
|
||||
"reactnative": { path: "./extensions/applicationinsights-react-native",
|
||||
cfg: {
|
||||
src: [
|
||||
"./extensions/applicationinsights-react-native/src/**/*.ts"
|
||||
]
|
||||
}
|
||||
},
|
||||
|
||||
// Tools
|
||||
"rollupuglify": { path: "./tools/rollup-plugin-uglify3-js",
|
||||
cfg: {
|
||||
src: [
|
||||
"./tools/rollup-plugin-uglify3-js/src/*.ts",
|
||||
"!node_modules/**"
|
||||
],
|
||||
out: './tools/rollup-plugin-uglify3-js/out/src/uglify3-js.js'
|
||||
}
|
||||
},
|
||||
"rollupes3": { path: "./tools/rollup-es3" },
|
||||
"shims": { path: "./tools/shims",
|
||||
cfg: {
|
||||
src: [
|
||||
"./tools/shims/src/*.ts"
|
||||
]
|
||||
}
|
||||
},
|
||||
|
||||
// Common
|
||||
"tst-framework": { path: "./common/Tests/Framework",
|
||||
cfg: {
|
||||
src: [
|
||||
"./common/Tests/Framework/src/*.ts"
|
||||
]
|
||||
}
|
||||
}
|
||||
}), {
|
||||
ts: {
|
||||
options: {
|
||||
comments: true,
|
||||
debug: true
|
||||
},
|
||||
coreunittest: {
|
||||
tsconfig: './shared/AppInsightsCore/Tests/tsconfig.json',
|
||||
src: [
|
||||
'./shared/AppInsightsCore/Tests/Unit/src/**/*.ts'
|
||||
],
|
||||
out: 'shared/AppInsightsCore/Tests/Unit/dist/aicoreunit.tests.js'
|
||||
},
|
||||
coreperftest: {
|
||||
tsconfig: './shared/AppInsightsCore/Tests/tsconfig.json',
|
||||
src: [
|
||||
'./shared/AppInsightsCore/Tests/Perf/src/**/*.ts'
|
||||
],
|
||||
out: 'shared/AppInsightsCore/Tests/Perf/dist/aicoreperf.tests.js'
|
||||
},
|
||||
commonunittest: {
|
||||
tsconfig: './shared/AppInsightsCommon/Tests/tsconfig.json',
|
||||
src: [
|
||||
'./shared/AppInsightsCommon/Tests/Unit/src/**/*.ts',
|
||||
],
|
||||
out: 'shared/AppInsightsCommon/Tests/Unit/dist/aicommon.tests.js'
|
||||
},
|
||||
appinsightsunittests: {
|
||||
tsconfig: './extensions/applicationinsights-analytics-js/Tests/tsconfig.json',
|
||||
src: [
|
||||
'./extensions/applicationinsights-analytics-js/Tests/Unit/src/**/*.ts'
|
||||
],
|
||||
out: 'extensions/applicationinsights-analytics-js/Tests/Unit/dist/appinsights-analytics.tests.js'
|
||||
},
|
||||
aiskutests: {
|
||||
tsconfig: './AISKU/Tests/tsconfig.json',
|
||||
src: [
|
||||
'AISKU/Tests/Selenium/*.ts',
|
||||
'AISKU/Tests/*.ts'
|
||||
],
|
||||
out: 'AISKU/Tests/Selenium/appinsights-sdk.tests.js'
|
||||
},
|
||||
clickanalyticstests: {
|
||||
tsconfig: './extensions/applicationinsights-clickanalytics-js/Tests/tsconfig.json',
|
||||
src: [
|
||||
'./extensions/applicationinsights-clickanalytics-js/Tests/Unit/src/**/*.ts'
|
||||
],
|
||||
out: 'extensions/applicationinsights-clickanalytics-js/Tests/Unit/dist/appinsights-clickanalytics.tests.js'
|
||||
},
|
||||
perfmarkmeasureunittests: {
|
||||
tsconfig: './extensions/applicationinsights-perfmarkmeasure-js/Tests/tsconfig.json',
|
||||
src: [ './extensions/applicationinsights-perfmarkmeasure-js/Tests/Unit/src/**/*.ts' ],
|
||||
out: './extensions/applicationinsights-perfmarkmeasure-js/Tests/Unit/dist/appinsights-perfmarkmeasure.tests.js'
|
||||
},
|
||||
propertiesunittests: {
|
||||
tsconfig: './extensions/applicationinsights-properties-js/Tests/tsconfig.json',
|
||||
src: [ './extensions/applicationinsights-properties-js/Tests/Unit/src/**/*.ts' ],
|
||||
out: './extensions/applicationinsights-properties-js/Tests/Unit/dist/prop.tests.js'
|
||||
},
|
||||
reactnativetests: {
|
||||
tsconfig: './extensions/applicationinsights-react-native/Tests/tsconfig.json',
|
||||
src: [ './extensions/applicationinsights-react-native/Tests/Unit/src/**/*.ts' ],
|
||||
out: './extensions/applicationinsights-react-native/Tests/Unit/dist/reactnativeplugin.tests.js'
|
||||
},
|
||||
reacttests: {
|
||||
tsconfig: './extensions/applicationinsights-react/Tests/tsconfig.json',
|
||||
src: [ './extensions/applicationinsights-react/Tests/Unit/src/**/*.ts' ],
|
||||
out: './extensions/applicationinsights-react/Tests/Unit/dist/reactplugin.tests.js'
|
||||
},
|
||||
depsunittest: {
|
||||
tsconfig: './extensions/applicationinsights-dependencies-js/Tests/tsconfig.json',
|
||||
src: [
|
||||
'./extensions/applicationinsights-dependencies-js/Tests/Unit/src/**/*.ts'
|
||||
],
|
||||
out: './extensions/applicationinsights-dependencies-js/Tests/Unit/dist/dependencies.tests.js'
|
||||
},
|
||||
aichanneltest: {
|
||||
tsconfig: './channels/applicationinsights-channel-js/Tests/tsconfig.json',
|
||||
src: [
|
||||
'./channels/applicationinsights-channel-js/Tests/Unit/src/**/*.ts'
|
||||
],
|
||||
out: './channels/applicationinsights-channel-js/Tests/Unit/dist/aichannel.tests.js'
|
||||
},
|
||||
rollupes3test: {
|
||||
tsconfig: './tools/rollup-es3/Tests/tsconfig.json',
|
||||
src: [
|
||||
'./tools/rollup-es3/Tests/Unit/src/**/*.ts'
|
||||
],
|
||||
out: './tools/rollup-es3/Tests/Unit/dist/es3rolluptests.js'
|
||||
},
|
||||
shimstest: {
|
||||
tsconfig: './tools/shims/Tests/tsconfig.json',
|
||||
src: [
|
||||
'./tools/shims/Tests/Unit/src**/*.ts'
|
||||
],
|
||||
out: './tools/shims/Tests/Unit/dist/shimstests.js'
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
function tsBuildActions(name, addTests, replaceName) {
|
||||
var actions = [
|
||||
"eslint-ts:" + name + "-lint-fix"
|
||||
];
|
||||
|
||||
var gruntTsConfig = theBuildConfig["ts"];
|
||||
if (replaceName) {
|
||||
actions.push("string-replace:" + replaceName);
|
||||
actions.push("ts:" + name);
|
||||
|
||||
if (addTests && gruntTsConfig[name + "-tests"]) {
|
||||
actions.push("ts:" + name + "-tests");
|
||||
}
|
||||
|
||||
actions.push("string-replace:" + replaceName + "-reverse");
|
||||
} else {
|
||||
actions.push("ts:" + name);
|
||||
if (addTests && gruntTsConfig[name + "-tests"]) {
|
||||
actions.push("ts:" + name + "-tests");
|
||||
}
|
||||
}
|
||||
|
||||
actions.push("eslint-ts:" + name + "-lint");
|
||||
|
||||
return actions;
|
||||
}
|
||||
|
||||
grunt.initConfig(deepMerge(
|
||||
theBuildConfig, {
|
||||
uglify: {
|
||||
snippetvNext: {
|
||||
files: {
|
||||
'AISKU/snippet/snippet.min.js': ['AISKU/snippet/snippet.js']
|
||||
},
|
||||
output: {
|
||||
webkit:true
|
||||
options: {
|
||||
sourceMap: false,
|
||||
ie8: true,
|
||||
compress: {
|
||||
passes:3,
|
||||
unsafe: true,
|
||||
},
|
||||
output: {
|
||||
webkit:true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
qunit: {
|
||||
all: {
|
||||
options: {
|
||||
}
|
||||
},
|
||||
core: {
|
||||
options: {
|
||||
urls: [
|
||||
'http://localhost:9001/shared/AppInsightsCore/Tests/UnitTests.html'
|
||||
],
|
||||
timeout: 300 * 1000, // 5 min
|
||||
console: true,
|
||||
summaryOnly: false,
|
||||
'--web-security': 'false' // we need this to allow CORS requests in PhantomJS
|
||||
}
|
||||
},
|
||||
coreperf: {
|
||||
options: {
|
||||
urls: [
|
||||
'http://localhost:9001/shared/AppInsightsCore/Tests/PerfTests.html'
|
||||
],
|
||||
timeout: 300 * 1000, // 5 min
|
||||
console: true,
|
||||
summaryOnly: false,
|
||||
'--web-security': 'false' // we need this to allow CORS requests in PhantomJS
|
||||
}
|
||||
},
|
||||
common: {
|
||||
options: {
|
||||
urls: [
|
||||
'http://localhost:9001/shared/AppInsightsCommon/Tests/UnitTests.html'
|
||||
],
|
||||
timeout: 300 * 1000, // 5 min
|
||||
console: true,
|
||||
summaryOnly: false,
|
||||
'--web-security': 'false' // we need this to allow CORS requests in PhantomJS
|
||||
}
|
||||
},
|
||||
aitests: {
|
||||
options: {
|
||||
urls: [
|
||||
'http://localhost:9001/extensions/applicationinsights-analytics-js/Tests/UnitTests.html'
|
||||
],
|
||||
timeout: 300 * 1000, // 5 min
|
||||
console: true,
|
||||
summaryOnly: false,
|
||||
'--web-security': 'false' // we need this to allow CORS requests in PhantomJS
|
||||
}
|
||||
},
|
||||
deps: {
|
||||
options: {
|
||||
urls: [
|
||||
'http://localhost:9001/extensions/applicationinsights-dependencies-js/Tests/UnitTests.html'
|
||||
],
|
||||
timeout: 300 * 1000, // 5 min
|
||||
console: true,
|
||||
summaryOnly: false,
|
||||
'--web-security': 'false'
|
||||
}
|
||||
},
|
||||
perfmarkmeasure: {
|
||||
options: {
|
||||
urls: [
|
||||
'http://localhost:9001/extensions/applicationinsights-perfmarkmeasure-js/Tests/UnitTests.html'
|
||||
],
|
||||
timeout: 5 * 60 * 1000, // 5 min
|
||||
console: false,
|
||||
summaryOnly: true,
|
||||
'--web-security': 'false'
|
||||
}
|
||||
},
|
||||
properties: {
|
||||
options: {
|
||||
urls: [
|
||||
'http://localhost:9001/extensions/applicationinsights-properties-js/Tests/UnitTests.html'
|
||||
],
|
||||
timeout: 5 * 60 * 1000, // 5 min
|
||||
console: false,
|
||||
summaryOnly: true,
|
||||
'--web-security': 'false'
|
||||
}
|
||||
},
|
||||
reactnative: {
|
||||
options: {
|
||||
urls: [
|
||||
'http://localhost:9001/extensions/applicationinsights-react-native/Tests/Selenium/Tests.html'
|
||||
],
|
||||
timeout: 5 * 60 * 1000, // 5 min
|
||||
console: true,
|
||||
summaryOnly: true,
|
||||
'--web-security': 'false'
|
||||
}
|
||||
},
|
||||
aisku: {
|
||||
options: {
|
||||
urls: [
|
||||
'http://localhost:9001/AISKU/Tests/Selenium/Tests.html'
|
||||
],
|
||||
timeout: 5 * 60 * 1000, // 5 min
|
||||
console: true,
|
||||
summaryOnly: false,
|
||||
'--web-security': 'false'
|
||||
}
|
||||
},
|
||||
aichannel: {
|
||||
options: {
|
||||
urls: [
|
||||
'http://localhost:9001/channels/applicationinsights-channel-js/Tests/UnitTests.html'
|
||||
],
|
||||
timeout: 300 * 1000, // 5 min
|
||||
console: false,
|
||||
summaryOnly: true,
|
||||
'--web-security': 'false'
|
||||
}
|
||||
},
|
||||
rollupes3: {
|
||||
options: {
|
||||
urls: [
|
||||
qunit: {
|
||||
all: {
|
||||
options: {
|
||||
}
|
||||
},
|
||||
core: {
|
||||
options: {
|
||||
urls: [
|
||||
'http://localhost:9001/shared/AppInsightsCore/Tests/UnitTests.html'
|
||||
],
|
||||
timeout: 300 * 1000, // 5 min
|
||||
console: true,
|
||||
summaryOnly: false,
|
||||
'--web-security': 'false' // we need this to allow CORS requests in PhantomJS
|
||||
}
|
||||
},
|
||||
coreperf: {
|
||||
options: {
|
||||
urls: [
|
||||
'http://localhost:9001/shared/AppInsightsCore/Tests/PerfTests.html'
|
||||
],
|
||||
timeout: 300 * 1000, // 5 min
|
||||
console: true,
|
||||
summaryOnly: false,
|
||||
'--web-security': 'false' // we need this to allow CORS requests in PhantomJS
|
||||
}
|
||||
},
|
||||
common: {
|
||||
options: {
|
||||
urls: [
|
||||
'http://localhost:9001/shared/AppInsightsCommon/Tests/UnitTests.html'
|
||||
],
|
||||
timeout: 300 * 1000, // 5 min
|
||||
console: true,
|
||||
summaryOnly: false,
|
||||
'--web-security': 'false' // we need this to allow CORS requests in PhantomJS
|
||||
}
|
||||
},
|
||||
aitests: {
|
||||
options: {
|
||||
urls: [
|
||||
'http://localhost:9001/extensions/applicationinsights-analytics-js/Tests/UnitTests.html'
|
||||
],
|
||||
timeout: 300 * 1000, // 5 min
|
||||
console: true,
|
||||
summaryOnly: false,
|
||||
'--web-security': 'false' // we need this to allow CORS requests in PhantomJS
|
||||
}
|
||||
},
|
||||
deps: {
|
||||
options: {
|
||||
urls: [
|
||||
'http://localhost:9001/extensions/applicationinsights-dependencies-js/Tests/UnitTests.html'
|
||||
],
|
||||
timeout: 300 * 1000, // 5 min
|
||||
console: true,
|
||||
summaryOnly: false,
|
||||
'--web-security': 'false'
|
||||
}
|
||||
},
|
||||
perfmarkmeasure: {
|
||||
options: {
|
||||
urls: [
|
||||
'http://localhost:9001/extensions/applicationinsights-perfmarkmeasure-js/Tests/UnitTests.html'
|
||||
],
|
||||
timeout: 5 * 60 * 1000, // 5 min
|
||||
console: false,
|
||||
summaryOnly: true,
|
||||
'--web-security': 'false'
|
||||
}
|
||||
},
|
||||
properties: {
|
||||
options: {
|
||||
urls: [
|
||||
'http://localhost:9001/extensions/applicationinsights-properties-js/Tests/UnitTests.html'
|
||||
],
|
||||
timeout: 5 * 60 * 1000, // 5 min
|
||||
console: false,
|
||||
summaryOnly: true,
|
||||
'--web-security': 'false'
|
||||
}
|
||||
},
|
||||
react: {
|
||||
options: {
|
||||
urls: [
|
||||
'http://localhost:9001/extensions/applicationinsights-react-js/Tests/Selenium/Tests.html'
|
||||
],
|
||||
timeout: 5 * 60 * 1000, // 5 min
|
||||
console: true,
|
||||
summaryOnly: true,
|
||||
'--web-security': 'false'
|
||||
}
|
||||
},
|
||||
reactnative: {
|
||||
options: {
|
||||
urls: [
|
||||
'http://localhost:9001/extensions/applicationinsights-react-native/Tests/UnitTests.html'
|
||||
],
|
||||
timeout: 5 * 60 * 1000, // 5 min
|
||||
console: true,
|
||||
summaryOnly: true,
|
||||
'--web-security': 'false'
|
||||
}
|
||||
},
|
||||
aisku: {
|
||||
options: {
|
||||
urls: [
|
||||
'http://localhost:9001/AISKU/Tests/Selenium/Tests.html'
|
||||
],
|
||||
timeout: 5 * 60 * 1000, // 5 min
|
||||
console: true,
|
||||
summaryOnly: false,
|
||||
'--web-security': 'false'
|
||||
}
|
||||
},
|
||||
aichannel: {
|
||||
options: {
|
||||
urls: [
|
||||
'http://localhost:9001/channels/applicationinsights-channel-js/Tests/UnitTests.html'
|
||||
],
|
||||
timeout: 300 * 1000, // 5 min
|
||||
console: false,
|
||||
summaryOnly: true,
|
||||
'--web-security': 'false'
|
||||
}
|
||||
},
|
||||
rollupes3: {
|
||||
options: {
|
||||
urls: [
|
||||
'./tools/rollup-es3/Tests/UnitTests.html'
|
||||
],
|
||||
timeout: 300 * 1000, // 5 min
|
||||
console: false,
|
||||
summaryOnly: true,
|
||||
'--web-security': 'false' // we need this to allow CORS requests in PhantomJS
|
||||
}
|
||||
},
|
||||
shims: {
|
||||
options: {
|
||||
urls: [
|
||||
],
|
||||
timeout: 300 * 1000, // 5 min
|
||||
console: false,
|
||||
summaryOnly: true,
|
||||
'--web-security': 'false' // we need this to allow CORS requests in PhantomJS
|
||||
}
|
||||
},
|
||||
shims: {
|
||||
options: {
|
||||
urls: [
|
||||
'./tools/shims/Tests/UnitTests.html'
|
||||
],
|
||||
timeout: 300 * 1000, // 5 min
|
||||
console: false,
|
||||
summaryOnly: true,
|
||||
'--web-security': 'false' // we need this to allow CORS requests in PhantomJS
|
||||
}
|
||||
},
|
||||
clickanalytics: {
|
||||
options: {
|
||||
urls: [
|
||||
],
|
||||
timeout: 300 * 1000, // 5 min
|
||||
console: false,
|
||||
summaryOnly: true,
|
||||
'--web-security': 'false' // we need this to allow CORS requests in PhantomJS
|
||||
}
|
||||
},
|
||||
clickanalytics: {
|
||||
options: {
|
||||
urls: [
|
||||
'http://localhost:9001/extensions/applicationinsights-clickanalytics-js/Tests/UnitTests.html'
|
||||
],
|
||||
timeout: 300 * 1000, // 5 min
|
||||
console: true,
|
||||
summaryOnly: false,
|
||||
'--web-security': 'false' // we need this to allow CORS requests in PhantomJS
|
||||
}
|
||||
],
|
||||
timeout: 300 * 1000, // 5 min
|
||||
console: true,
|
||||
summaryOnly: false,
|
||||
'--web-security': 'false' // we need this to allow CORS requests in PhantomJS
|
||||
}
|
||||
},
|
||||
},
|
||||
},
|
||||
connect: {
|
||||
server: {
|
||||
options: {
|
||||
port: 9001,
|
||||
base: '.'
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
grunt.event.on('qunit.testStart', function (name) {
|
||||
grunt.log.ok('Running test: ' + name);
|
||||
});
|
||||
|
||||
grunt.loadNpmTasks("@nevware21/grunt-ts-plugin");
|
||||
grunt.loadNpmTasks('grunt-tslint');
|
||||
grunt.loadNpmTasks('grunt-contrib-uglify');
|
||||
grunt.loadNpmTasks('grunt-contrib-qunit');
|
||||
grunt.loadNpmTasks('grunt-contrib-connect');
|
||||
grunt.loadNpmTasks('grunt-run');
|
||||
grunt.registerTask("default", ["ts:rollupuglify", "ts:rollupes3", "ts:rollupes3test", "qunit:rollupes3", "ts:shims", "ts:shimstest", "qunit:shims", "ts:default", "uglify:ai", "uglify:snippet"]);
|
||||
grunt.registerTask("core", ["ts:core"]);
|
||||
grunt.registerTask("common", ["ts:common"]);
|
||||
grunt.registerTask("module", ["ts:module"]);
|
||||
grunt.registerTask("ai", ["ts:appinsights"]);
|
||||
grunt.registerTask("aitests", ["connect", "ts:appinsightsunittests", "qunit:aitests"]);
|
||||
grunt.registerTask("aisku", ["ts:aisku"]);
|
||||
grunt.registerTask("aiskulite", ["ts:aiskulite"]);
|
||||
grunt.registerTask("snippetvnext", ["uglify:snippetvNext"]);
|
||||
grunt.registerTask("aiskutests", ["connect", "ts:aiskutests", "qunit:aisku"]);
|
||||
grunt.registerTask("test", ["connect", "ts:default", "ts:test", "ts:testSchema", "ts:testE2E", "qunit:all"]);
|
||||
grunt.registerTask("test1ds", ["coreunittest", "common", "propertiestests", "depstest", "aitests", "aiskutests", "reactnativetests", "reacttests"]);
|
||||
grunt.registerTask("coreunittest", ["connect", "ts:coreunittest", "qunit:core"]);
|
||||
grunt.registerTask("coreperftest", ["connect", "ts:coreperftest", "qunit:coreperf"]);
|
||||
grunt.registerTask("commontest", ["connect", "ts:common", "ts:commonunittest", "qunit:common"]);
|
||||
grunt.registerTask("perfmarkmeasure", ["ts:perfmarkmeasure"]);
|
||||
grunt.registerTask("perfmarkmeasuretests", ["connect", "ts:perfmarkmeasureunittests", "qunit:perfmarkmeasure"]);
|
||||
grunt.registerTask("properties", ["ts:properties"]);
|
||||
grunt.registerTask("propertiestests", ["connect", "ts:propertiesunittests", "qunit:properties"]);
|
||||
grunt.registerTask("reactnative", ["ts:reactnative"]);
|
||||
grunt.registerTask("reactnativetests", ["connect", "qunit:reactnative"]);
|
||||
grunt.registerTask("deps", ["ts:deps"]);
|
||||
grunt.registerTask("depstest", [ "connect", "ts:depsunittest","qunit:deps"]);
|
||||
grunt.registerTask("debugplugin", ["ts:debugplugin"]);
|
||||
grunt.registerTask("aichannel", ["ts:aichannel"]);
|
||||
grunt.registerTask("aichanneltest", ["connect", "ts:aichanneltest", "qunit:aichannel"]);
|
||||
grunt.registerTask("rollupuglify", ["ts:rollupuglify"]);
|
||||
grunt.registerTask("rollupes3", ["ts:rollupes3", "ts:rollupes3test", "qunit:rollupes3"]);
|
||||
grunt.registerTask("rollupes3test", ["connect", "ts:rollupes3test", "qunit:rollupes3"]);
|
||||
grunt.registerTask("shims", ["ts:shims", "ts:shimstest", "qunit:shims"]);
|
||||
grunt.registerTask("shimstest", ["connect", "ts:shimstest", "qunit:shims"]);
|
||||
grunt.registerTask("clickanalytics", ["ts:clickanalytics"]);
|
||||
grunt.registerTask("clickanalyticstests", ["connect", "ts:clickanalyticstests", "qunit:clickanalytics"]);
|
||||
grunt.registerTask("tst-framework", ["ts:tst-framework"]);
|
||||
grunt.registerTask("serve", ["connect:server:keepalive"]);
|
||||
connect: {
|
||||
server: {
|
||||
options: {
|
||||
port: 9001,
|
||||
base: '.'
|
||||
}
|
||||
}
|
||||
}
|
||||
}));
|
||||
|
||||
grunt.event.on('qunit.testStart', function (name) {
|
||||
grunt.log.ok('Running test: ' + name);
|
||||
});
|
||||
|
||||
grunt.loadNpmTasks("@nevware21/grunt-ts-plugin");
|
||||
grunt.loadNpmTasks("@nevware21/grunt-eslint-ts");
|
||||
grunt.loadNpmTasks('grunt-contrib-uglify');
|
||||
grunt.loadNpmTasks('grunt-contrib-qunit');
|
||||
grunt.loadNpmTasks('grunt-contrib-connect');
|
||||
grunt.loadNpmTasks('grunt-run');
|
||||
grunt.registerTask("default", ["ts:rollupuglify", "ts:rollupes3", "ts:rollupes3test", "qunit:rollupes3", "ts:shims", "ts:shimstest", "qunit:shims", "ts:default", "uglify:ai", "uglify:snippet"]);
|
||||
grunt.registerTask("core", tsBuildActions("core"));
|
||||
grunt.registerTask("common", tsBuildActions("common"));
|
||||
grunt.registerTask("ai", tsBuildActions("appinsights"));
|
||||
grunt.registerTask("aitests", ["connect", "ts:appinsightsunittests", "qunit:aitests"]);
|
||||
grunt.registerTask("aisku", tsBuildActions("aisku"));
|
||||
grunt.registerTask("aiskulite", tsBuildActions("aiskulite"));
|
||||
grunt.registerTask("snippetvnext", ["uglify:snippetvNext"]);
|
||||
grunt.registerTask("aiskutests", ["connect", "ts:aiskutests", "qunit:aisku"]);
|
||||
grunt.registerTask("test", ["connect", "ts:default", "ts:test", "ts:testSchema", "ts:testE2E", "qunit:all"]);
|
||||
grunt.registerTask("test1ds", ["coretest", "common", "propertiestests", "depstest", "aitests", "aiskutests", "reactnativetests", "reacttests"]);
|
||||
grunt.registerTask("coreunittest", ["connect", "ts:coreunittest", "qunit:core"]);
|
||||
grunt.registerTask("coreperftest", ["connect", "ts:coreperftest", "qunit:coreperf"]);
|
||||
grunt.registerTask("commontest", ["connect", "ts:common", "ts:commonunittest", "qunit:common"]);
|
||||
grunt.registerTask("perfmarkmeasure", tsBuildActions("perfmarkmeasure"));
|
||||
grunt.registerTask("perfmarkmeasuretests", ["connect", "ts:perfmarkmeasureunittests", "qunit:perfmarkmeasure"]);
|
||||
grunt.registerTask("properties", tsBuildActions("properties"));
|
||||
grunt.registerTask("propertiestests", ["connect", "ts:propertiesunittests", "qunit:properties"]);
|
||||
grunt.registerTask("react", tsBuildActions("react"));
|
||||
grunt.registerTask("reacttests", ["connect", "ts:reacttests", "qunit:react"]);
|
||||
grunt.registerTask("reactnative", tsBuildActions("reactnative"));
|
||||
grunt.registerTask("reactnativetests", ["connect", "ts:reactnativetests", "qunit:reactnative"]);
|
||||
grunt.registerTask("deps", tsBuildActions("deps"));
|
||||
grunt.registerTask("depstest", [ "connect", "ts:depsunittest","qunit:deps"]);
|
||||
grunt.registerTask("debugplugin", tsBuildActions("debugplugin"));
|
||||
grunt.registerTask("aichannel", tsBuildActions("aichannel"));
|
||||
grunt.registerTask("aichanneltest", ["connect", "ts:aichanneltest", "qunit:aichannel"]);
|
||||
grunt.registerTask("rollupuglify", tsBuildActions("rollupuglify"));
|
||||
grunt.registerTask("rollupes3", tsBuildActions("rollupes3").concat(["ts:rollupes3test", "qunit:rollupes3"]));
|
||||
grunt.registerTask("rollupes3test", ["ts:rollupes3test", "qunit:rollupes3"]);
|
||||
grunt.registerTask("shims", tsBuildActions("shims").concat(["ts:shimstest", "qunit:shims"]));
|
||||
grunt.registerTask("shimstest", ["ts:shimstest", "qunit:shims"]);
|
||||
grunt.registerTask("clickanalytics", tsBuildActions("clickanalytics"));
|
||||
grunt.registerTask("clickanalyticstests", ["connect", "ts:clickanalyticstests", "qunit:clickanalytics"]);
|
||||
grunt.registerTask("tst-framework", tsBuildActions("tst-framework"));
|
||||
grunt.registerTask("serve", ["connect:server:keepalive"]);
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
console.error("stack: '" + e.stack + "', message: '" + e.message + "', name: '" + e.name + "'");
|
||||
}
|
||||
};
|
||||
|
|
26
package.json
26
package.json
|
@ -13,6 +13,7 @@
|
|||
"postinstall": "node common/scripts/install-run-rush-silent.js update",
|
||||
"build": "node common/scripts/install-run-rush.js rebuild --verbose",
|
||||
"rebuild": "npm run build",
|
||||
"testx": "rush test --verbose",
|
||||
"test": "node common/scripts/install-run-rush.js test --verbose",
|
||||
"lint": "node common/scripts/install-run-rush.js lint --verbose",
|
||||
"perftest": "node common/scripts/install-run-rush.js perftest --verbose",
|
||||
|
@ -20,6 +21,7 @@
|
|||
"rupdate": "node common/scripts/install-run-rush.js update --recheck --purge --full",
|
||||
"serve": "grunt serve",
|
||||
"setVersion": "node ./tools/release-tools/setVersion.js",
|
||||
"purge": "node common/scripts/install-run-rush.js purge",
|
||||
"fullClean": "git clean -xdf && npm install && rush update --recheck --full",
|
||||
"fullCleanBuild": "npm run fullClean && npm run rebuild"
|
||||
},
|
||||
|
@ -36,22 +38,26 @@
|
|||
"devDependencies": {
|
||||
"@microsoft/rush": "^5.50.0",
|
||||
"@nevware21/grunt-ts-plugin": "^0.4.3",
|
||||
"chromium": "^3.0.2",
|
||||
"connect": "^3.7.0",
|
||||
"grunt": "^1.4.1",
|
||||
"grunt-cli": "^1.4.3",
|
||||
"grunt-contrib-connect": "^3.0.0",
|
||||
"grunt-contrib-qunit": "^5.0.1",
|
||||
"grunt-contrib-uglify": "^5.0.1",
|
||||
"grunt-run": "^0.8.1",
|
||||
"grunt-tslint": "^5.0.2",
|
||||
"globby": "^11.0.0",
|
||||
"puppeteer": "^10.1.0",
|
||||
"tslint": "^5.19.0",
|
||||
"tslint-config-prettier": "^1.18.0",
|
||||
"tslint-microsoft-contrib": "^5.2.1",
|
||||
"@nevware21/grunt-eslint-ts": "^0.2.1",
|
||||
"@typescript-eslint/eslint-plugin": "^4.28.0",
|
||||
"@typescript-eslint/parser": "^4.28.0",
|
||||
"eslint": "^7.29.0",
|
||||
"eslint-config-standard": "^16.0.3",
|
||||
"eslint-plugin-import": "^2.23.4",
|
||||
"eslint-plugin-node": "^11.1.0",
|
||||
"eslint-plugin-promise": "^5.1.0",
|
||||
"eslint-plugin-security": "^1.4.0",
|
||||
"typescript": "^4.3.4",
|
||||
"whatwg-fetch": "^3.0.0",
|
||||
"typedoc": "^0.16.9",
|
||||
"typescript": "2.5.3",
|
||||
"whatwg-fetch": "^3.0.0"
|
||||
"connect": "^3.7.0",
|
||||
"puppeteer": "^10.1.0",
|
||||
"chromium": "^3.0.2"
|
||||
}
|
||||
}
|
||||
|
|
11
rush.json
11
rush.json
|
@ -1,4 +1,3 @@
|
|||
|
||||
{
|
||||
"$schema": "https://developer.microsoft.com/json-schemas/rush/v5/rush.schema.json",
|
||||
|
||||
|
@ -71,6 +70,16 @@
|
|||
"projectFolder": "extensions/applicationinsights-clickanalytics-js",
|
||||
"shouldPublish": true
|
||||
},
|
||||
{
|
||||
"packageName": "@microsoft/applicationinsights-react-js",
|
||||
"projectFolder": "extensions/applicationinsights-react-js",
|
||||
"shouldPublish": true
|
||||
},
|
||||
{
|
||||
"packageName": "@microsoft/applicationinsights-react-native",
|
||||
"projectFolder": "extensions/applicationinsights-react-native",
|
||||
"shouldPublish": true
|
||||
},
|
||||
{
|
||||
"packageName": "@microsoft/applicationinsights-channel-js",
|
||||
"projectFolder": "channels/applicationinsights-channel-js",
|
||||
|
|
|
@ -26,23 +26,25 @@
|
|||
"@microsoft/ai-test-framework": "0.0.1",
|
||||
"@microsoft/applicationinsights-rollup-plugin-uglify3-js": "1.0.0",
|
||||
"@microsoft/applicationinsights-rollup-es3": "1.1.3",
|
||||
"@microsoft/api-extractor": "^7.9.11",
|
||||
"@microsoft/api-extractor": "^7.18.1",
|
||||
"grunt": "^1.4.1",
|
||||
"grunt-cli": "^1.4.3",
|
||||
"grunt-contrib-qunit": "^5.0.1",
|
||||
"@nevware21/grunt-ts-plugin": "^0.4.3",
|
||||
"@nevware21/grunt-eslint-ts": "^0.2.1",
|
||||
"@rollup/plugin-commonjs": "^18.0.0",
|
||||
"@rollup/plugin-node-resolve": "^11.2.1",
|
||||
"@rollup/plugin-replace": "^2.3.3",
|
||||
"rollup-plugin-cleanup": "3.2.1",
|
||||
"rollup": "^2.32.0",
|
||||
"typescript": "2.5.3",
|
||||
"tslib": "^1.13.0",
|
||||
"tslint": "^5.19.0",
|
||||
"tslint-config-prettier": "^1.18.0",
|
||||
"typescript": "^4.3.4",
|
||||
"tslib": "^2.0.0",
|
||||
"globby": "^11.0.0",
|
||||
"magic-string": "^0.25.7"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"tslib": "*"
|
||||
},
|
||||
"dependencies": {
|
||||
"@microsoft/applicationinsights-shims": "2.0.0",
|
||||
"@microsoft/applicationinsights-core-js": "2.6.5",
|
||||
|
|
|
@ -38,11 +38,12 @@
|
|||
"@microsoft/ai-test-framework": "0.0.1",
|
||||
"@microsoft/applicationinsights-rollup-plugin-uglify3-js": "1.0.0",
|
||||
"@microsoft/applicationinsights-rollup-es3": "1.1.3",
|
||||
"@microsoft/api-extractor": "^7.9.11",
|
||||
"@microsoft/api-extractor": "^7.18.1",
|
||||
"grunt": "^1.4.1",
|
||||
"grunt-cli": "^1.4.3",
|
||||
"grunt-contrib-qunit": "^5.0.1",
|
||||
"@nevware21/grunt-ts-plugin": "^0.4.3",
|
||||
"@nevware21/grunt-eslint-ts": "^0.2.1",
|
||||
"globby": "^11.0.0",
|
||||
"magic-string": "^0.25.7",
|
||||
"pako": "^2.0.3",
|
||||
|
@ -51,14 +52,14 @@
|
|||
"@rollup/plugin-replace": "^2.3.3",
|
||||
"rollup-plugin-cleanup": "3.2.1",
|
||||
"rollup": "^2.32.0",
|
||||
"tslint": "^5.19.0",
|
||||
"tslint-config-prettier": "^1.18.0",
|
||||
"tslint-microsoft-contrib": "^5.2.1",
|
||||
"typescript": "2.5.3",
|
||||
"tslib": "^1.13.0",
|
||||
"typescript": "^4.3.4",
|
||||
"tslib": "^2.0.0",
|
||||
"qunit": "^2.11.2",
|
||||
"sinon": "^7.3.1"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"tslib": "*"
|
||||
},
|
||||
"dependencies": {
|
||||
"@microsoft/applicationinsights-shims": "2.0.0",
|
||||
"@microsoft/dynamicproto-js": "^1.1.4"
|
||||
|
|
|
@ -313,5 +313,4 @@ export class BaseCore implements IAppInsightsCore {
|
|||
protected releaseQueue() {
|
||||
// @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -11,6 +11,8 @@
|
|||
"noEmitHelpers": true,
|
||||
"skipLibCheck": true,
|
||||
"alwaysStrict": true,
|
||||
"skipLibCheck": true,
|
||||
"skipDefaultLibCheck": true,
|
||||
"declaration": true,
|
||||
"declarationDir": "shared/AppInsightsCore/types",
|
||||
"outDir": "./dist-esm",
|
||||
|
|
|
@ -11,7 +11,6 @@ let isReact = false;
|
|||
let isReactNative = false;
|
||||
|
||||
const theVersion = require(process.cwd() + "/version.json");
|
||||
const orgBaseVersion = theVersion.release || "";
|
||||
const orgPkgVersions = {};
|
||||
|
||||
function showHelp() {
|
||||
|
@ -478,7 +477,6 @@ if (parseArgs()) {
|
|||
// Rewrite the file
|
||||
const newContent = JSON.stringify(theVersion, null, 4) + "\n";
|
||||
fs.writeFileSync(process.cwd() + "/version.json", newContent);
|
||||
changed = true;
|
||||
}
|
||||
|
||||
} else {
|
||||
|
|
|
@ -38,20 +38,20 @@
|
|||
"grunt-cli": "^1.4.3",
|
||||
"grunt-contrib-qunit": "^5.0.1",
|
||||
"@nevware21/grunt-ts-plugin": "^0.4.3",
|
||||
"grunt-tslint": "^5.0.2",
|
||||
"@nevware21/grunt-eslint-ts": "^0.2.1",
|
||||
"@rollup/plugin-commonjs": "^18.0.0",
|
||||
"@rollup/plugin-node-resolve": "^11.2.1",
|
||||
"@rollup/plugin-replace": "^2.3.3",
|
||||
"rollup-plugin-minify-es": "^1.1.1",
|
||||
"rollup": "^2.32.0",
|
||||
"tslint": "^5.19.0",
|
||||
"tslint-config-prettier": "^1.18.0",
|
||||
"tslint-microsoft-contrib": "^5.2.1",
|
||||
"typescript": "2.5.3",
|
||||
"tslib": "^1.13.0",
|
||||
"typescript": "^4.3.4",
|
||||
"tslib": "^2.0.0",
|
||||
"magic-string": "^0.25.7",
|
||||
"chromium": "^3.0.2"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"tslib": "*"
|
||||
},
|
||||
"dependencies": {
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
"rules": {
|
||||
"no-prototype-builtins": "off",
|
||||
}
|
||||
}
|
|
@ -29,17 +29,17 @@
|
|||
"grunt-cli": "^1.4.3",
|
||||
"grunt-contrib-qunit": "^5.0.1",
|
||||
"@nevware21/grunt-ts-plugin": "^0.4.3",
|
||||
"grunt-tslint": "^5.0.2",
|
||||
"@nevware21/grunt-eslint-ts": "^0.2.1",
|
||||
"@rollup/plugin-commonjs": "^18.0.0",
|
||||
"@rollup/plugin-node-resolve": "^11.2.1",
|
||||
"@rollup/plugin-replace": "^2.3.3",
|
||||
"rollup-plugin-minify-es": "^1.1.1",
|
||||
"rollup": "^2.32.0",
|
||||
"tslint": "^5.19.0",
|
||||
"tslint-config-prettier": "^1.18.0",
|
||||
"tslint-microsoft-contrib": "^5.2.1",
|
||||
"typescript": "2.5.3",
|
||||
"tslib": "^1.13.0"
|
||||
"typescript": "^4.3.4",
|
||||
"tslib": "^2.0.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"tslib": "*"
|
||||
},
|
||||
"dependencies": {
|
||||
"uglify-js": "^3.11.0"
|
||||
|
|
|
@ -5,11 +5,12 @@
|
|||
"noImplicitAny": false,
|
||||
"module": "amd",
|
||||
"moduleResolution": "node",
|
||||
"target": "es3",
|
||||
"target": "es5",
|
||||
"alwaysStrict": true,
|
||||
"declaration": true,
|
||||
"importHelpers": false,
|
||||
"noEmitHelpers": true
|
||||
"noEmitHelpers": true,
|
||||
"skipLibCheck": true
|
||||
},
|
||||
"files": [],
|
||||
"exclude": [
|
||||
|
|
|
@ -42,15 +42,13 @@
|
|||
"grunt-contrib-qunit": "^5.0.1",
|
||||
"grunt-run": "^0.8.1",
|
||||
"@nevware21/grunt-ts-plugin": "^0.4.3",
|
||||
"@nevware21/grunt-eslint-ts": "^0.2.1",
|
||||
"@rollup/plugin-commonjs": "^18.0.0",
|
||||
"@rollup/plugin-node-resolve": "^11.2.1",
|
||||
"@rollup/plugin-replace": "^2.3.3",
|
||||
"rollup-plugin-minify-es": "^1.1.1",
|
||||
"rollup": "^2.32.0",
|
||||
"tslint": "^5.19.0",
|
||||
"tslint-config-prettier": "^1.18.0",
|
||||
"tslint-microsoft-contrib": "^5.2.1",
|
||||
"typescript": "2.5.3"
|
||||
"typescript": "^4.3.4"
|
||||
},
|
||||
"dependencies": {
|
||||
}
|
||||
|
|
|
@ -89,7 +89,7 @@ export function __decorateFn(decorators: any, target: any, key: any, desc: any)
|
|||
r = ReflectObj[strDecorate](decorators, target, key, desc);
|
||||
} else {
|
||||
for (var i = decorators.length - 1; i >= 0; i--) {
|
||||
// tslint:disable-next-line:no-conditional-assignment
|
||||
// eslint-disable-next-line no-cond-assign
|
||||
if (d = decorators[i]) {
|
||||
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
||||
}
|
||||
|
@ -180,7 +180,7 @@ export function __readFn(o: any, n: any) {
|
|||
}
|
||||
} finally {
|
||||
if (e) {
|
||||
// tslint:disable-next-line:no-unsafe-finally
|
||||
// eslint-disable-next-line no-unsafe-finally
|
||||
throw e.error;
|
||||
}
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче