Skip to content

Commit

Permalink
Remove puppeteer changes as some test require the sandbox
Browse files Browse the repository at this point in the history
  • Loading branch information
Amelia Magee committed Sep 11, 2024
1 parent 36d87fd commit 4a50a03
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 17 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@
},
"scripts": {
"start": "docker compose up -d && grunt",
"coverage": "PUPPETEER_ARGS='--no-sandbox' PUPPETEER_EXECUTABLE_PATH=$(which chromium) mochify --transform [ babelify ] --plugin [ mochify-istanbul --exclude '**/+(tests|node_modules|libs)/**/*' --report lcov --dir ./coverage --instrumenter babel-istanbul] --reporter spec ./tests/harness/common './tests/js/web/**/*Test.js'",
"coverage": "mochify --transform [ babelify ] --plugin [ mochify-istanbul --exclude '**/+(tests|node_modules|libs)/**/*' --report lcov --dir ./coverage --instrumenter babel-istanbul] --reporter spec ./tests/harness/common './tests/js/web/**/*Test.js'",
"test": "npm run test:headless",
"build:tests": "grunt javascript:tests",
"build:tests:watch": "grunt javascript:tests:watch",
"test:headless": "PUPPETEER_ARGS='--no-sandbox' PUPPETEER_EXECUTABLE_PATH=$(which chromium) mochify --reporter spec --transform [ babelify ] ./tests/harness/common './tests/js/web/**/*Test.js'",
"test:headless": "mochify --reporter spec --transform [ babelify ] ./tests/harness/common './tests/js/web/**/*Test.js'",
"test:browser": "npm run build:tests && open ./tests/js/web/index.html",
"test:browser:watch": "npm run build:tests:watch"
},
Expand Down
16 changes: 1 addition & 15 deletions tests/js/web/Notifications/FaviconEditorTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,21 +145,7 @@ describe('FaviconEditor', () => {
faviconEditor = new FaviconEditor($root[0]);
faviconEditor.init();

// Override serializer to return raw image data, we cannot use the default
// canvas.toDataURL(...) here as the png compression is different when
// in the browser / headless test environments
faviconEditor.setSerializer((canvas, ctx) => {
const imageData = ctx.getImageData(0, 0, canvas.width, canvas.height);
const debugCvs = document.createElement('canvas');
const debugCtx = debugCvs.getContext('2d');

debugCtx.width = canvas.width;
debugCtx.height = canvas.height;
debugCtx.putImageData(imageData, 0, 0);
actual = debugCvs.toDataURL('image/png');

return [...imageData.data];
});
canvas.toDataURL('image/png');

faviconEditor.addCircleNotification('red', 5)
.then((data) => {
Expand Down

0 comments on commit 4a50a03

Please sign in to comment.