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
2 changes: 2 additions & 0 deletions .changeset/new-chrome-tests.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
---
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
"./examples/*"
],
"resolutions": {
"grunt-contrib-qunit/puppeteer": "24.22.0",
"eslint-plugin-sonarjs/typescript": "5.8.2"
},
"volta": {
Expand Down
11 changes: 11 additions & 0 deletions packages/joint-core/Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,17 @@ module.exports = function(grunt) {
if (name.indexOf('grunt-') === 0) grunt.loadNpmTasks(name);
});

// Karma's ChromeHeadless launcher starts the browser at `CHROME_BIN`, and
// Puppeteer only resolves the path of the browser it installs asynchronously,
// so this task sets it before the karma tasks run
grunt.registerTask('chrome-bin', 'Point CHROME_BIN at the browser Puppeteer installs', function() {
var done = this.async();
require('puppeteer').executablePath().then(function(executablePath) {
process.env.CHROME_BIN = executablePath;
done();
}, done);
});

Object.keys(aliases).forEach(function(name) {
grunt.registerTask(name, aliases[name]);
});
Expand Down
1 change: 1 addition & 0 deletions packages/joint-core/grunt/config/aliases.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ module.exports = function(grunt) {
'test:bundles'
],
'test:src': [
'chrome-bin',
'karma:geometry',
'karma:vectorizer',
'karma:joint'
Expand Down
8 changes: 3 additions & 5 deletions packages/joint-core/grunt/config/karma.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
const puppeteer = require('puppeteer');
const dependencies = require('../resources/dependencies');
const modules = require('../resources/esm');
const coverageThresholds = require('../../coverage.json');

// Used for starting Chrome if using ChromeHeadless in Jenkins
process.env.CHROME_BIN = puppeteer.executablePath();

// Which path should .lcov files record as root they are relative to?
// - SonarQube (`.github/workflows/sonar.yml`) needs this to be the repo root
const REPOSITORY_ROOT = '../..';
Expand Down Expand Up @@ -57,7 +53,9 @@ module.exports = function(grunt) {
'--no-sandbox',
'--headless',
'--disable-gpu',
'--disable-dev-shm-usage'
'--disable-dev-shm-usage',
// Keep macOS from asking for the keychain password on launch
'--use-mock-keychain'
]
}
},
Expand Down
4 changes: 2 additions & 2 deletions packages/joint-core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@
"grunt-contrib-clean": "2.0.0",
"grunt-contrib-concat": "1.0.1",
"grunt-contrib-copy": "1.0.0",
"grunt-contrib-qunit": "7.0.1",
"grunt-contrib-qunit": "11.0.0",
"grunt-contrib-uglify": "4.0.1",
"grunt-karma": "4.0.2",
"grunt-newer": "1.3.0",
Expand All @@ -117,7 +117,7 @@
"karma-sourcemap-loader": "^0.4.0",
"lodash": "^4.18.1",
"mocha": "12.0.3",
"puppeteer": "24.22.0",
"puppeteer": "25.16.0",
"qunit": "2.24.1",
"requirejs": "2.3.8",
"rollup": "4.64.12",
Expand Down
11 changes: 7 additions & 4 deletions packages/joint-core/test/geometry/require.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
require.config({
baseUrl: '../../',
paths: {
'qunit': 'node_modules/qunit/qunit/qunit'
}
baseUrl: '../../'
});

// The global QUnit (see `requirejs.html`), as a module.
// eslint-disable-next-line no-undef
define('qunit', [], function() {
return window.QUnit;
});

require(['qunit'], function(QUnit) {
Expand Down
4 changes: 4 additions & 0 deletions packages/joint-core/test/geometry/requirejs.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
</head>
<body>
<div id="qunit"></div>
<!-- QUnit is loaded as a global (the grunt-contrib-qunit bridge expects one),
only the code under test is loaded through RequireJS -->
<script src="../../node_modules/qunit/qunit/qunit.js"></script>
<script>QUnit.config.autostart = false;</script>
<script src="../../node_modules/requirejs/require.js"></script>
<script src="require.js"></script>
</body>
Expand Down
8 changes: 6 additions & 2 deletions packages/joint-core/test/jointjs/require.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
require.config({
baseUrl: '../../',
paths: {
'qunit': 'node_modules/qunit/qunit/qunit',

// Dependencies for Joint:
'jquery': 'node_modules/jquery/dist/jquery',
'lodash': 'node_modules/lodash/lodash',
'dagre': 'node_modules/dagre/dist/dagre'
}
});

// The global QUnit (see `requirejs.html`), as a module.
// eslint-disable-next-line no-undef
define('qunit', [], function() {
return window.QUnit;
});

require(['qunit'], function(QUnit) {

QUnit.start();
Expand Down
4 changes: 4 additions & 0 deletions packages/joint-core/test/jointjs/requirejs.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
</head>
<body>
<div id="qunit"></div>
<!-- QUnit is loaded as a global (the grunt-contrib-qunit bridge expects one),
only the code under test is loaded through RequireJS -->
<script src="../../node_modules/qunit/qunit/qunit.js"></script>
<script>QUnit.config.autostart = false;</script>
<script src="../../node_modules/requirejs/require.js"></script>
<script src="./require.js"></script>
</body>
Expand Down
11 changes: 7 additions & 4 deletions packages/joint-core/test/vectorizer/require.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
require.config({
baseUrl: '../../',
paths: {
'qunit': 'node_modules/qunit/qunit/qunit',
}
baseUrl: '../../'
});

// The global QUnit (see `requirejs.html`), as a module.
// eslint-disable-next-line no-undef
define('qunit', [], function() {
return window.QUnit;
});

require(['qunit'], function(QUnit) {
Expand Down
4 changes: 4 additions & 0 deletions packages/joint-core/test/vectorizer/requirejs.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
</head>
<body>
<div id="qunit"></div>
<!-- QUnit is loaded as a global (the grunt-contrib-qunit bridge expects one),
only the code under test is loaded through RequireJS -->
<script src="../../node_modules/qunit/qunit/qunit.js"></script>
<script>QUnit.config.autostart = false;</script>
<script src="../../node_modules/requirejs/require.js"></script>
<script src="./require.js"></script>
</body>
Expand Down
13 changes: 8 additions & 5 deletions packages/joint-layout-directed-graph/karma.conf.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
const puppeteer = require('puppeteer');
const coverageThresholds = require('./coverage.json');

// Used for starting Chrome if using ChromeHeadless in Jenkins
process.env.CHROME_BIN = puppeteer.executablePath();

// Coverage is collected for this and source-mapped to `DirectedGraph.mjs`
const TEST_BUNDLE = './build/test/DirectedGraph.js';

// Which path should .lcov files record as root they are relative to?
// - SonarQube (`.github/workflows/sonar.yml`) needs this to be the repo root
const REPOSITORY_ROOT = '../..';

module.exports = function(config) {
module.exports = async function(config) {
// Karma's ChromeHeadless launcher starts the browser at `CHROME_BIN` - the one
// Puppeteer installs, whose path it only resolves asynchronously
process.env.CHROME_BIN = await puppeteer.executablePath();

config.set({
basePath: '.',
files: [
Expand Down Expand Up @@ -41,7 +42,9 @@ module.exports = function(config) {
'--no-sandbox',
'--headless',
'--disable-gpu',
'--disable-dev-shm-usage'
'--disable-dev-shm-usage',
// Keep macOS from asking for the keychain password on launch
'--use-mock-keychain'
]
}
},
Expand Down
2 changes: 1 addition & 1 deletion packages/joint-layout-directed-graph/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
"karma-qunit": "4.2.1",
"karma-sourcemap-loader": "^0.4.0",
"mocha": "12.0.3",
"puppeteer": "24.22.0",
"puppeteer": "25.16.0",
"qunit": "2.24.1",
"requirejs": "2.3.8",
"rollup": "4.64.12",
Expand Down
13 changes: 8 additions & 5 deletions packages/joint-layout-elk/karma.conf.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
const puppeteer = require('puppeteer');
const coverageThresholds = require('./coverage.json');

// Used for starting Chrome if using ChromeHeadless in Jenkins
process.env.CHROME_BIN = puppeteer.executablePath();

// Coverage is collected for this and source-mapped to `src/*.mts`
const TEST_BUNDLE = './build/test/index.js';

// Which path should .lcov files record as root they are relative to?
// - SonarQube (`.github/workflows/sonar.yml`) needs this to be the repo root
const REPOSITORY_ROOT = '../..';

module.exports = function(config) {
module.exports = async function(config) {
// Karma's ChromeHeadless launcher starts the browser at `CHROME_BIN` - the one
// Puppeteer installs, whose path it only resolves asynchronously
process.env.CHROME_BIN = await puppeteer.executablePath();

config.set({
basePath: '.',
files: [
Expand Down Expand Up @@ -42,7 +43,9 @@ module.exports = function(config) {
'--no-sandbox',
'--headless',
'--disable-gpu',
'--disable-dev-shm-usage'
'--disable-dev-shm-usage',
// Keep macOS from asking for the keychain password on launch
'--use-mock-keychain'
]
}
},
Expand Down
2 changes: 1 addition & 1 deletion packages/joint-layout-elk/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
"karma-coverage": "^2.2.1",
"karma-qunit": "^4.1.2",
"karma-sourcemap-loader": "^0.4.0",
"puppeteer": "24.22.0",
"puppeteer": "25.16.0",
"qunit": "^2.24.1",
"rollup": "4.64.12",
"rollup-plugin-banner2": "^1.2.2",
Expand Down
13 changes: 8 additions & 5 deletions packages/joint-layout-msagl/karma.conf.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
const puppeteer = require('puppeteer');
const coverageThresholds = require('./coverage.json');

// Used for starting Chrome if using ChromeHeadless in Jenkins
process.env.CHROME_BIN = puppeteer.executablePath();

// Coverage is collected for this and source-mapped to `src/*.mts`
const TEST_BUNDLE = './build/test/index.js';

// Which path should .lcov files record as root they are relative to?
// - SonarQube (`.github/workflows/sonar.yml`) needs this to be the repo root
const REPOSITORY_ROOT = '../..';

module.exports = function(config) {
module.exports = async function(config) {
// Karma's ChromeHeadless launcher starts the browser at `CHROME_BIN` - the one
// Puppeteer installs, whose path it only resolves asynchronously
process.env.CHROME_BIN = await puppeteer.executablePath();

config.set({
basePath: '.',
files: [
Expand Down Expand Up @@ -40,7 +41,9 @@ module.exports = function(config) {
'--no-sandbox',
'--headless',
'--disable-gpu',
'--disable-dev-shm-usage'
'--disable-dev-shm-usage',
// Keep macOS from asking for the keychain password on launch
'--use-mock-keychain'
]
}
},
Expand Down
2 changes: 1 addition & 1 deletion packages/joint-layout-msagl/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
"karma-coverage": "^2.2.1",
"karma-qunit": "^4.1.2",
"karma-sourcemap-loader": "^0.4.0",
"puppeteer": "24.22.0",
"puppeteer": "25.16.0",
"qunit": "^2.24.1",
"rollup": "4.64.12",
"rollup-plugin-banner2": "^1.2.2",
Expand Down
13 changes: 9 additions & 4 deletions packages/joint-router-avoid/karma.conf.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
// Used for starting Chrome if using ChromeHeadless in Jenkins
process.env.CHROME_BIN = require('puppeteer').executablePath();
const puppeteer = require('puppeteer');

module.exports = async function(config) {
// Karma's ChromeHeadless launcher starts the browser at `CHROME_BIN` - the one
// Puppeteer installs, whose path it only resolves asynchronously
process.env.CHROME_BIN = await puppeteer.executablePath();

module.exports = function(config) {
config.set({
basePath: '.',
files: [
Expand Down Expand Up @@ -38,7 +41,9 @@ module.exports = function(config) {
'--no-sandbox',
'--headless',
'--disable-gpu',
'--disable-dev-shm-usage'
'--disable-dev-shm-usage',
// Keep macOS from asking for the keychain password on launch
'--use-mock-keychain'
]
}
},
Expand Down
2 changes: 1 addition & 1 deletion packages/joint-router-avoid/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
"karma-chrome-launcher": "^3.2.0",
"karma-coverage": "^2.2.1",
"karma-qunit": "^4.1.2",
"puppeteer": "24.22.0",
"puppeteer": "25.16.0",
"qunit": "^2.24.1",
"rollup": "4.64.12",
"rollup-plugin-banner2": "^1.2.2",
Expand Down
13 changes: 8 additions & 5 deletions packages/joint-sanitize/karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@ const path = require('path');
const puppeteer = require('puppeteer');
const coverageThresholds = require('./coverage.json');

// Used for starting Chrome if using ChromeHeadless in Jenkins
process.env.CHROME_BIN = puppeteer.executablePath();

// Coverage is collected for this and source-mapped to `src/`
const TEST_BUNDLE = './build/test/sanitize.js';

Expand All @@ -15,7 +12,11 @@ const JOINT_CORE = path.resolve(path.dirname(require.resolve('@joint/core')), '.
// - SonarQube (`.github/workflows/sonar.yml`) needs this to be the repo root
const REPOSITORY_ROOT = '../..';

module.exports = function(config) {
module.exports = async function(config) {
// Karma's ChromeHeadless launcher starts the browser at `CHROME_BIN` - the one
// Puppeteer installs, whose path it only resolves asynchronously
process.env.CHROME_BIN = await puppeteer.executablePath();

config.set({
basePath: '.',
files: [
Expand Down Expand Up @@ -43,7 +44,9 @@ module.exports = function(config) {
'--no-sandbox',
'--headless',
'--disable-gpu',
'--disable-dev-shm-usage'
'--disable-dev-shm-usage',
// Keep macOS from asking for the keychain password on launch
'--use-mock-keychain'
]
}
},
Expand Down
2 changes: 1 addition & 1 deletion packages/joint-sanitize/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
"karma-qunit": "4.2.1",
"karma-sourcemap-loader": "^0.4.0",
"mocha": "11.1.0",
"puppeteer": "24.22.0",
"puppeteer": "25.16.0",
"qunit": "2.24.1",
"rollup": "4.36.0",
"rollup-plugin-banner2": "^1.2.2"
Expand Down
Loading
Loading