Skip to content

Commit

Permalink
Use path aliases in the unit tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
dlemstra committed Oct 18, 2023
1 parent eb38214 commit 28bc47e
Show file tree
Hide file tree
Showing 181 changed files with 500 additions and 489 deletions.
6 changes: 3 additions & 3 deletions tests/coders/heic.spec.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// Copyright Dirk Lemstra https://github.com/dlemstra/magick-wasm.
// Licensed under the Apache License, Version 2.0.

import { ImageMagick } from '../../src/image-magick';
import { MagickFormat } from '../../src/magick-format';
import { TestImages } from '../test-images';
import { ImageMagick } from '@src/image-magick';
import { MagickFormat } from '@src/magick-format';
import { TestImages } from '@test/test-images';

describe('Coders#heic', () => {
it('should be able to write avif image', () => {
Expand Down
4 changes: 2 additions & 2 deletions tests/coders/jxl.spec.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// Copyright Dirk Lemstra https://github.com/dlemstra/magick-wasm.
// Licensed under the Apache License, Version 2.0.

import { MagickFormat } from '../../src/magick-format';
import { TestImages } from '../test-images';
import { MagickFormat } from '@src/magick-format';
import { TestImages } from '@test/test-images';

describe('Coders#jxl', () => {
it('should be able to write jxl image', () => {
Expand Down
4 changes: 2 additions & 2 deletions tests/custom-environment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
// Licensed under the Apache License, Version 2.0.

import { CustomMatchers, ICustomMatchers } from './custom-matcher';
import { ImageMagick, initializeImageMagick } from '../src/image-magick';
import { ImageMagick, initializeImageMagick } from '@src/image-magick';
import { ImageMagickApi } from '@dlemstra/magick-native/magick';
import { Magick } from '../src/magick';
import { Magick } from '@src/magick';
import { TestFonts } from './test-fonts';
import * as fs from 'fs';

Expand Down
8 changes: 4 additions & 4 deletions tests/custom-matcher.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
// Copyright Dirk Lemstra https://github.com/dlemstra/magick-wasm.
// Licensed under the Apache License, Version 2.0.

import { IMagickImage } from '../src/magick-image';
import { MagickColor } from '../src/magick-color';
import { PixelChannel } from '../src/pixel-channel';
import { Quantum } from '../src/quantum';
import { IMagickImage } from '@src/magick-image';
import { MagickColor } from '@src/magick-color';
import { PixelChannel } from '@src/pixel-channel';
import { Quantum } from '@src/quantum';

interface MatcherResult {
pass: boolean;
Expand Down
8 changes: 4 additions & 4 deletions tests/defines/defines-creator.spec.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
// Copyright Dirk Lemstra https://github.com/dlemstra/magick-wasm.
// Licensed under the Apache License, Version 2.0.

import { IDefine } from '../../src/defines/define';
import { DefinesCreator } from '../../src/defines/defines-creator';
import { MagickFormat } from '../../src/magick-format';
import { MagickReadSettings } from '../../src/settings/magick-read-settings';
import { IDefine } from '@src/defines/define';
import { DefinesCreator } from '@src/defines/defines-creator';
import { MagickFormat } from '@src/magick-format';
import { MagickReadSettings } from '@src/settings/magick-read-settings';

class TestDefinesCreator extends DefinesCreator {
constructor() {
Expand Down
4 changes: 2 additions & 2 deletions tests/density/constructor.spec.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// Copyright Dirk Lemstra https://github.com/dlemstra/magick-wasm.
// Licensed under the Apache License, Version 2.0.

import { Density } from '../../src/density';
import { DensityUnit } from '../../src/density-unit';
import { Density } from '@src/density';
import { DensityUnit } from '@src/density-unit';

describe('Density#constructor', () => {
it('should set the properties', () => {
Expand Down
8 changes: 4 additions & 4 deletions tests/drawables/drawable-color.spec.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
// Copyright Dirk Lemstra https://github.com/dlemstra/magick-wasm.
// Licensed under the Apache License, Version 2.0.

import { DrawableColor } from '../../src/drawables/drawable-color';
import { MagickColors } from '../../src/magick-colors';
import { PaintMethod } from '../../src/paint-method';
import { TestImages } from '../test-images';
import { DrawableColor } from '@src/drawables/drawable-color';
import { MagickColors } from '@src/magick-colors';
import { PaintMethod } from '@src/paint-method';
import { TestImages } from '@test/test-images';

describe('DrawableColor', () => {
it('should color the image with the default fill color', () => {
Expand Down
10 changes: 5 additions & 5 deletions tests/drawables/drawable-fill-color.spec.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
// Copyright Dirk Lemstra https://github.com/dlemstra/magick-wasm.
// Licensed under the Apache License, Version 2.0.

import { DrawableColor } from '../../src/drawables/drawable-color';
import { DrawableFillColor } from '../../src/drawables/drawable-fill-color';
import { MagickColors } from '../../src/magick-colors';
import { PaintMethod } from '../../src/paint-method';
import { TestImages } from '../test-images';
import { DrawableColor } from '@src/drawables/drawable-color';
import { DrawableFillColor } from '@src/drawables/drawable-fill-color';
import { MagickColors } from '@src/magick-colors';
import { PaintMethod } from '@src/paint-method';
import { TestImages } from '@test/test-images';

describe('DrawableFillColor', () => {
it('should set the fill color for following drawing actions', () => {
Expand Down
14 changes: 7 additions & 7 deletions tests/drawables/drawable-fill-opacity.spec.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
// Copyright Dirk Lemstra https://github.com/dlemstra/magick-wasm.
// Licensed under the Apache License, Version 2.0.

import { DrawableColor } from '../../src/drawables/drawable-color';
import { DrawableFillColor } from '../../src/drawables/drawable-fill-color';
import { DrawableFillOpacity } from '../../src/drawables/drawable-fill-opacity';
import { MagickColor } from '../../src/magick-color';
import { PaintMethod } from '../../src/paint-method';
import { Percentage } from '../../src/percentage';
import { TestImages } from '../test-images';
import { DrawableColor } from '@src/drawables/drawable-color';
import { DrawableFillColor } from '@src/drawables/drawable-fill-color';
import { DrawableFillOpacity } from '@src/drawables/drawable-fill-opacity';
import { MagickColor } from '@src/magick-color';
import { PaintMethod } from '@src/paint-method';
import { Percentage } from '@src/percentage';
import { TestImages } from '@test/test-images';

describe('DrawableFillOpacity', () => {
it('should set the fill color opacity for following drawing actions', () => {
Expand Down
18 changes: 9 additions & 9 deletions tests/drawables/drawable-gravity.spec.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
// Copyright Dirk Lemstra https://github.com/dlemstra/magick-wasm.
// Licensed under the Apache License, Version 2.0.

import { DrawableFillColor } from '../../src/drawables/drawable-fill-color';
import { DrawableFont } from '../../src/drawables/drawable-font';
import { DrawableFontPointSize } from '../../src/drawables/drawable-font-point-size';
import { DrawableGravity } from '../../src/drawables/drawable-gravity';
import { DrawableText } from '../../src/drawables/drawable-text';
import { Gravity } from '../../src/gravity';
import { MagickColors } from '../../src/magick-colors';
import { TestFonts } from '../test-fonts';
import { TestImages } from '../test-images';
import { DrawableFillColor } from '@src/drawables/drawable-fill-color';
import { DrawableFont } from '@src/drawables/drawable-font';
import { DrawableFontPointSize } from '@src/drawables/drawable-font-point-size';
import { DrawableGravity } from '@src/drawables/drawable-gravity';
import { DrawableText } from '@src/drawables/drawable-text';
import { Gravity } from '@src/gravity';
import { MagickColors } from '@src/magick-colors';
import { TestFonts } from '@test/test-fonts';
import { TestImages } from '@test/test-images';

describe('DrawableGravity', () => {
it.each([
Expand Down
8 changes: 4 additions & 4 deletions tests/drawables/drawable-rectangle.spec.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
// Copyright Dirk Lemstra https://github.com/dlemstra/magick-wasm.
// Licensed under the Apache License, Version 2.0.

import { DrawableRectangle } from '../../src/drawables/drawable-rectangle';
import { DrawableFillColor } from '../../src/drawables/drawable-fill-color';
import { MagickColors } from '../../src/magick-colors';
import { TestImages } from '../test-images';
import { DrawableRectangle } from '@src/drawables/drawable-rectangle';
import { DrawableFillColor } from '@src/drawables/drawable-fill-color';
import { MagickColors } from '@src/magick-colors';
import { TestImages } from '@test/test-images';

describe('DrawableRectangle', () => {
it('should draw a rectangle', () => {
Expand Down
8 changes: 4 additions & 4 deletions tests/drawables/drawable-round-rectangle.spec.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
// Copyright Dirk Lemstra https://github.com/dlemstra/magick-wasm.
// Licensed under the Apache License, Version 2.0.

import { DrawableRoundRectangle } from '../../src/drawables/drawable-round-rectangle';
import { DrawableFillColor } from '../../src/drawables/drawable-fill-color';
import { MagickColors } from '../../src/magick-colors';
import { TestImages } from '../test-images';
import { DrawableRoundRectangle } from '@src/drawables/drawable-round-rectangle';
import { DrawableFillColor } from '@src/drawables/drawable-fill-color';
import { MagickColors } from '@src/magick-colors';
import { TestImages } from '@test/test-images';

describe('DrawableRoundRectangle', () => {
it('should draw a rounded rectangle', () => {
Expand Down
14 changes: 7 additions & 7 deletions tests/drawables/drawable-text.spec.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
// Copyright Dirk Lemstra https://github.com/dlemstra/magick-wasm.
// Licensed under the Apache License, Version 2.0.

import { DrawableText } from '../../src/drawables/drawable-text';
import { DrawableFillColor } from '../../src/drawables/drawable-fill-color';
import { DrawableFont } from '../../src/drawables/drawable-font';
import { DrawableFontPointSize } from '../../src/drawables/drawable-font-point-size';
import { MagickColor } from '../../src/magick-color';
import { TestFonts } from '../test-fonts';
import { TestImages } from '../test-images';
import { DrawableText } from '@src/drawables/drawable-text';
import { DrawableFillColor } from '@src/drawables/drawable-fill-color';
import { DrawableFont } from '@src/drawables/drawable-font';
import { DrawableFontPointSize } from '@src/drawables/drawable-font-point-size';
import { MagickColor } from '@src/magick-color';
import { TestFonts } from '@test/test-fonts';
import { TestImages } from '@test/test-images';

describe('DrawableText', () => {
it('should write text to the image', () => {
Expand Down
8 changes: 4 additions & 4 deletions tests/formats/dng/dng-read-defines.spec.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
// Copyright Dirk Lemstra https://github.com/dlemstra/magick-wasm.
// Licensed under the Apache License, Version 2.0.

import { DngOutputColor } from '../../../src/formats/dng/dng-output-color';
import { DngReadDefines } from '../../../src/formats/dng/dng-read-defines';
import { MagickFormat } from '../../../src/magick-format';
import { MagickReadSettings } from '../../../src/settings/magick-read-settings';
import { DngOutputColor } from '@src/formats/dng/dng-output-color';
import { DngReadDefines } from '@src/formats/dng/dng-read-defines';
import { MagickFormat } from '@src/magick-format';
import { MagickReadSettings } from '@src/settings/magick-read-settings';

let readSettings: MagickReadSettings;

Expand Down
8 changes: 4 additions & 4 deletions tests/image-magick/read-collection.spec.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
// Copyright Dirk Lemstra https://github.com/dlemstra/magick-wasm.
// Licensed under the Apache License, Version 2.0.

import { ImageMagick } from '../../src/image-magick';
import { MagickFormat } from '../../src/magick-format';
import { MagickReadSettings } from '../../src/settings/magick-read-settings';
import { TestImages } from '../test-images';
import { ImageMagick } from '@src/image-magick';
import { MagickFormat } from '@src/magick-format';
import { MagickReadSettings } from '@src/settings/magick-read-settings';
import { TestImages } from '@test/test-images';

function bogusAsyncMethod(): Promise<number> { return new Promise(resolve => resolve(1)); }

Expand Down
4 changes: 2 additions & 2 deletions tests/image-magick/read-from-canvas.spec.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// Copyright Dirk Lemstra https://github.com/dlemstra/magick-wasm.
// Licensed under the Apache License, Version 2.0.

import { ImageMagick } from '../../src/image-magick';
import { ImageMagick } from '@src/image-magick';
import { JSDOM } from 'jsdom';
import { MagickColors } from '../../src/magick-colors';
import { MagickColors } from '@src/magick-colors';

describe('ImageMagick#readFromCanvas', () => {
it('should read the image data from the canvas', () => {
Expand Down
10 changes: 5 additions & 5 deletions tests/image-magick/read.spec.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
// Copyright Dirk Lemstra https://github.com/dlemstra/magick-wasm.
// Licensed under the Apache License, Version 2.0.

import { ImageMagick } from '../../src/image-magick';
import { MagickColors } from '../../src/magick-colors';
import { MagickFormat } from '../../src/magick-format';
import { MagickReadSettings } from '../../src/settings/magick-read-settings';
import { TestImages } from '../test-images';
import { ImageMagick } from '@src/image-magick';
import { MagickColors } from '@src/magick-colors';
import { MagickFormat } from '@src/magick-format';
import { MagickReadSettings } from '@src/settings/magick-read-settings';
import { TestImages } from '@test/test-images';

function bogusAsyncMethod(): Promise<number> { return new Promise(resolve => resolve(1)); }

Expand Down
2 changes: 1 addition & 1 deletion tests/magick-color/constructor.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright Dirk Lemstra https://github.com/dlemstra/magick-wasm.
// Licensed under the Apache License, Version 2.0.

import { MagickColor } from '../../src/magick-color';
import { MagickColor } from '@src/magick-color';

describe('MagickColor#constructor', () => {
it('should set throw error when color is invalid', () => {
Expand Down
4 changes: 2 additions & 2 deletions tests/magick-color/to-short-string.spec.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// Copyright Dirk Lemstra https://github.com/dlemstra/magick-wasm.
// Licensed under the Apache License, Version 2.0.

import { MagickColor } from '../../src/magick-color';
import { Quantum } from '../../src/quantum';
import { MagickColor } from '@src/magick-color';
import { Quantum } from '@src/quantum';

describe('MagickColor#toShortString', () => {
it('should format the color', () => {
Expand Down
2 changes: 1 addition & 1 deletion tests/magick-color/to-string.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright Dirk Lemstra https://github.com/dlemstra/magick-wasm.
// Licensed under the Apache License, Version 2.0.

import { MagickColor } from '../../src/magick-color';
import { MagickColor } from '@src/magick-color';

describe('MagickColor#toString', () => {
it('should format the color', () => {
Expand Down
4 changes: 2 additions & 2 deletions tests/magick-format-info/all.spec.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// Copyright Dirk Lemstra https://github.com/dlemstra/magick-wasm.
// Licensed under the Apache License, Version 2.0.

import { MagickFormat } from '../../src/magick-format';
import { MagickFormatInfo } from '../../src/magick-format-info';
import { MagickFormat } from '@src/magick-format';
import { MagickFormatInfo } from '@src/magick-format-info';

describe('MagickFormatInfo#all', () => {
it('should have a format for all values', () => {
Expand Down
4 changes: 2 additions & 2 deletions tests/magick-format-info/create.spec.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// Copyright Dirk Lemstra https://github.com/dlemstra/magick-wasm.
// Licensed under the Apache License, Version 2.0.

import { MagickFormat } from '../../src/magick-format';
import { MagickFormatInfo } from '../../src/magick-format-info';
import { MagickFormat } from '@src/magick-format';
import { MagickFormatInfo } from '@src/magick-format-info';

describe('MagickFormatInfo#create', () => {
it('should return information for each format', () => {
Expand Down
2 changes: 1 addition & 1 deletion tests/magick-geometry/constructor.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright Dirk Lemstra https://github.com/dlemstra/magick-wasm.
// Licensed under the Apache License, Version 2.0.

import { MagickGeometry } from '../../src/magick-geometry';
import { MagickGeometry } from '@src/magick-geometry';

describe('MagickGeometry#constructor', () => {
it('should throw exception when value is invalid', () => {
Expand Down
2 changes: 1 addition & 1 deletion tests/magick-geometry/to-string.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright Dirk Lemstra https://github.com/dlemstra/magick-wasm.
// Licensed under the Apache License, Version 2.0.

import { MagickGeometry } from '../../src/magick-geometry';
import { MagickGeometry } from '@src/magick-geometry';

describe('MagickGeometry#toString', () => {
it('should only return with and height', () => {
Expand Down
4 changes: 2 additions & 2 deletions tests/magick-image-collection/append-horizontally.spec.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// Copyright Dirk Lemstra https://github.com/dlemstra/magick-wasm.
// Licensed under the Apache License, Version 2.0.

import { MagickImageCollection } from '../../src/magick-image-collection';
import { TestImages } from '../test-images';
import { MagickImageCollection } from '@src/magick-image-collection';
import { TestImages } from '@test/test-images';

describe('MagickImageCollection#appendHorizontally', () => {
it('should throw exception when collection is empty', () => {
Expand Down
4 changes: 2 additions & 2 deletions tests/magick-image-collection/append-vertically.spec.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// Copyright Dirk Lemstra https://github.com/dlemstra/magick-wasm.
// Licensed under the Apache License, Version 2.0.

import { MagickImageCollection } from '../../src/magick-image-collection';
import { TestImages } from '../test-images';
import { MagickImageCollection } from '@src/magick-image-collection';
import { TestImages } from '@test/test-images';

describe('MagickImageCollection#appendVertically', () => {
it('should throw exception when collection is empty', () => {
Expand Down
4 changes: 2 additions & 2 deletions tests/magick-image-collection/clone.spec.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// Copyright Dirk Lemstra https://github.com/dlemstra/magick-wasm.
// Licensed under the Apache License, Version 2.0.

import { ErrorMetric } from '../../src/error-metric';
import { TestImages } from '../test-images';
import { ErrorMetric } from '@src/error-metric';
import { TestImages } from '@test/test-images';

describe('MagickImageCollection#clone', () => {
it('should clone the images in the collection', () => {
Expand Down
2 changes: 1 addition & 1 deletion tests/magick-image-collection/dispose.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright Dirk Lemstra https://github.com/dlemstra/magick-wasm.
// Licensed under the Apache License, Version 2.0.

import { MagickImageCollection } from '../../src/magick-image-collection';
import { MagickImageCollection } from '@src/magick-image-collection';

describe('MagickImageCollection#dispose', () => {
it('should dispose the images', () => {
Expand Down
8 changes: 4 additions & 4 deletions tests/magick-image-collection/evaluate.spec.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
// Copyright Dirk Lemstra https://github.com/dlemstra/magick-wasm.
// Licensed under the Apache License, Version 2.0.

import { EvaluateOperator } from '../../src/evaluate-operator';
import { MagickColors } from '../../src/magick-colors';
import { MagickImage } from '../../src/magick-image';
import { MagickImageCollection } from '../../src/magick-image-collection';
import { EvaluateOperator } from '@src/evaluate-operator';
import { MagickColors } from '@src/magick-colors';
import { MagickImage } from '@src/magick-image';
import { MagickImageCollection } from '@src/magick-image-collection';

describe('MagickImageCollection#evaluate', () => {
it('should throw exception when collection is empty', () => {
Expand Down
Loading

0 comments on commit 28bc47e

Please sign in to comment.