Skip to content
Open
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: 0 additions & 2 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,6 @@ updates:
ignore:
- dependency-name: "chai"
versions: [">= 5.0.0"]
- dependency-name: "pixelmatch"
versions: ["> 5.3.0"]
groups:
# Group non-security version minor & patch updates into one PR.
# Security and major update versions will be done as individual PRs.
Expand Down
2 changes: 1 addition & 1 deletion cirq-web/cirq_web/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ PNG screenshot, and comparing it to an expected PNG.

We use [Mocha](https://mochajs.org) and [Chai](https://www.chaijs.com/) as our
main testing tools. For comparing image diffs, we use
[Pixelmatch](https://github.com/mapbox/pixelmatch) and
[BlazeDiff](https://www.blazediff.dev/) and
[pngjs](https://github.com/lukeapage/pngjs).

#### Unit testing
Expand Down
6 changes: 3 additions & 3 deletions cirq-web/cirq_web/e2e/bloch_sphere/bloch_sphere_e2e_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
import puppeteer from 'puppeteer';
import {expect} from 'chai';
import {readFileSync} from 'fs';
import pixelmatch from 'pixelmatch';
import blazediff from '@blazediff/core';
import * as PNG from 'pngjs';
import * as temp from 'temp';
import * as path from 'path';
Expand Down Expand Up @@ -79,7 +79,7 @@ describe('Bloch sphere', () => {
const {width, height} = expected;
const diff = new PNG.PNG({width, height});

const pixels = pixelmatch(expected.data, actual.data, diff.data, width, height, {
const pixels = blazediff(expected.data, actual.data, diff.data, width, height, {
threshold: 0.1,
});

Expand Down Expand Up @@ -107,7 +107,7 @@ describe('Bloch sphere', () => {
const {width, height} = expected;
const diff = new PNG.PNG({width, height});

const pixels = pixelmatch(expected.data, actual.data, diff.data, width, height, {
const pixels = blazediff(expected.data, actual.data, diff.data, width, height, {
threshold: 0.1,
});

Expand Down
26 changes: 13 additions & 13 deletions cirq-web/cirq_web/e2e/circuit/circuit_e2e_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
import puppeteer from 'puppeteer';
import {expect} from 'chai';
import {readFileSync} from 'fs';
import pixelmatch from 'pixelmatch';
import blazediff from '@blazediff/core';
import * as PNG from 'pngjs';
import * as temp from 'temp';
import * as path from 'path';
Expand Down Expand Up @@ -62,21 +62,21 @@ describe('Circuit', () => {
const circuit = createGridCircuit(
[
{
'wire_symbols': ['Z'],
'location_info': [{'row': 2, 'col': 3}],
'color_info': ['cyan'],
'wire_symbols': ['Z'],
'location_info': [{'row': 2, 'col': 3}],
'color_info': ['cyan'],
'moment': 0
},
{
'wire_symbols': ['X'],
'location_info': [{'row': 2, 'col': 3}],
'color_info': ['black'],
{
'wire_symbols': ['X'],
'location_info': [{'row': 2, 'col': 3}],
'color_info': ['black'],
'moment': 1
},
{
'wire_symbols': ['@', 'X'],
'location_info': [{'row': 3, 'col': 0}, {'row': 0, 'col': 0}],
'color_info': ['black', 'black'],
{
'wire_symbols': ['@', 'X'],
'location_info': [{'row': 3, 'col': 0}, {'row': 0, 'col': 0}],
'color_info': ['black', 'black'],
'moment': 0
},
], 5, 'mycircuitdiv'
Expand All @@ -93,7 +93,7 @@ describe('Circuit', () => {
const {width, height} = expected;
const diff = new PNG.PNG({width, height});

const pixels = pixelmatch(expected.data, actual.data, diff.data, width, height, {
const pixels = blazediff(expected.data, actual.data, diff.data, width, height, {
threshold: 0.1,
});

Expand Down
52 changes: 17 additions & 35 deletions cirq-web/cirq_web/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions cirq-web/cirq_web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@
"typescript": "^5.7.3"
},
"devDependencies": {
"@blazediff/core": "^1.1.0",
"@types/chai": "^4.2.18",
"@types/jsdom": "^21.1.7",
"@types/mocha": "^10.0.10",
"@types/node": "^24.0.8",
"@types/pixelmatch": "^5.2.4",
"@types/pngjs": "^6.0.0",
"@types/puppeteer": "^7.0.4",
"@types/temp": "^0.9.0",
Expand All @@ -30,7 +30,6 @@
"mocha": "^11.1.0",
"npm": "^11.0.0",
"nyc": "^17.1.0",
"pixelmatch": "^5.3.0",
"pngjs": "^7.0.0",
"puppeteer": "^24.1.0",
"temp": "^0.9.4",
Expand Down