Move image utilities into /spec to make it clear that they are only for testing
This commit is contained in:
parent
c05f40d960
commit
2e708ebb4d
|
@ -0,0 +1,5 @@
|
|||
import {matchers} from '../image/ImageSimilarity.mjs';
|
||||
|
||||
beforeAll(() => {
|
||||
jasmine.addMatchers(matchers);
|
||||
});
|
|
@ -1,7 +1,7 @@
|
|||
/* eslint-disable max-statements */
|
||||
|
||||
import ImageRegion from './ImageRegion.mjs';
|
||||
import {nodejs} from '../core/browser.mjs';
|
||||
import {nodejs} from '../../scripts/core/browser.mjs';
|
||||
|
||||
describe('ImageRegion', () => {
|
||||
function makeCanvas(w, h) {
|
|
@ -1,7 +1,7 @@
|
|||
import './Blur.mjs';
|
||||
import './Composition.mjs';
|
||||
import ImageRegion from './ImageRegion.mjs';
|
||||
import {headless} from '../core/browser.mjs';
|
||||
import {headless} from '../../scripts/core/browser.mjs';
|
||||
|
||||
function getThresholds({
|
||||
pixelThresh = 2,
|
|
@ -1,7 +1,6 @@
|
|||
import ImageRegion from '../image/ImageRegion.mjs';
|
||||
import SequenceDiagram from './SequenceDiagram.mjs';
|
||||
import TESTS from '../../spec/images/list.mjs';
|
||||
import {matchers} from '../image/ImageSimilarity.mjs';
|
||||
import ImageRegion from './image/ImageRegion.mjs';
|
||||
import SequenceDiagram from '../scripts/sequence/SequenceDiagram.mjs';
|
||||
import TESTS from './images/list.mjs';
|
||||
|
||||
describe('SequenceDiagram Visuals', () => {
|
||||
const RESOLUTION = 4;
|
||||
|
@ -48,8 +47,6 @@ describe('SequenceDiagram Visuals', () => {
|
|||
|
||||
TESTS.forEach((image) => {
|
||||
it('renders ' + image + ' as expected', (done) => {
|
||||
jasmine.addMatchers(matchers);
|
||||
|
||||
loadAndRenderURL(IMAGE_BASE_PATH + image)
|
||||
.then(({actual, expected, code}) => {
|
||||
const widthSm = Math.min(Math.round(actual.width / 4), 150);
|
|
@ -1,6 +1,5 @@
|
|||
import ImageRegion from '../image/ImageRegion.mjs';
|
||||
import SequenceDiagram from './SequenceDiagram.mjs';
|
||||
import {matchers} from '../image/ImageSimilarity.mjs';
|
||||
import ImageRegion from './image/ImageRegion.mjs';
|
||||
import SequenceDiagram from '../scripts/sequence/SequenceDiagram.mjs';
|
||||
|
||||
const RESOLUTION = 4;
|
||||
|
||||
|
@ -33,7 +32,6 @@ function makeSampleTests({file, code}, index) {
|
|||
describe('example #' + (index + 1), () => {
|
||||
if(file && !SCREENSHOT_BLACKLIST.includes(file)) {
|
||||
it('looks like ' + file + ' when rendered', (done) => {
|
||||
jasmine.addMatchers(matchers);
|
||||
let actual = null;
|
||||
new SequenceDiagram(code)
|
||||
.getCanvas({resolution: RESOLUTION})
|
Loading…
Reference in New Issue