Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions gruntfile.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,29 @@
module.exports = function (grunt) {
// Resolve a Puppeteer executable to use for the QUnit browser tests.
// On locally managed Windows devices, Defender/WDAC may block the unsigned
// Chromium that Puppeteer downloads to $HOME/.cache/puppeteer ("blocked by
// IT admin"). Falling back to the installed Microsoft Edge avoids that.
// Gated so CI / official builds keep using the bundled Chromium.
function _getBrowserExecutablePath() {
if (process.env.PUPPETEER_EXECUTABLE_PATH) {
return process.env.PUPPETEER_EXECUTABLE_PATH;
}
if (process.env.TF_BUILD || process.env.CI || process.env.BUILD_BUILDID) {
return undefined; // CI => use bundled Chromium
}
var candidates = [
process.env["ProgramFiles(x86)"] + "\\Microsoft\\Edge\\Application\\msedge.exe",
process.env["ProgramFiles"] + "\\Microsoft\\Edge\\Application\\msedge.exe"
];
for (var i = 0; i < candidates.length; i++) {
if (candidates[i] && grunt.file.exists(candidates[i])) {
return candidates[i];
}
}
return undefined;
}
var browserExecutablePath = _getBrowserExecutablePath();

grunt.initConfig({
"eslint-ts": {
default: {
Expand Down Expand Up @@ -61,6 +86,7 @@ module.exports = function (grunt) {
headless: "new",
timeout: 30000,
ignoreHTTPErrors: true,
executablePath: browserExecutablePath,
args: [
"--enable-precise-memory-info",
"--expose-internals-for-testing",
Expand All @@ -83,6 +109,7 @@ module.exports = function (grunt) {
headless: "new",
timeout: 30000,
ignoreHTTPErrors: true,
executablePath: browserExecutablePath,
args: [
"--enable-precise-memory-info",
"--expose-internals-for-testing",
Expand Down
12 changes: 11 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,17 @@
},
"homepage": "https://github.com/microsoft/DynamicProto-JS#readme",
"overrides": {
"minimatch": "~3.1.2"
"minimatch": "~3.1.2",
"brace-expansion": "^1.1.18",
"js-yaml": "^4.3.1",
"grunt": {
"js-yaml": "^3.15.1"
},
"linkify-it": "^5.0.2",
"markdown-it": "^14.3.0",
"morgan": "^1.11.0",
"ws": "^7.5.13",
"@types/node": "20.14.2"
},
"dependencies": {
"@nevware21/ts-utils": ">= 0.14.0 < 2.x"
Expand Down
Loading