Skip to content

Commit

Permalink
Merge pull request #11 from sourcetoad/wakeup
Browse files Browse the repository at this point in the history
Update dependencies
  • Loading branch information
erik-perri authored Jan 18, 2024
2 parents acb9306 + 313e1d6 commit 080164f
Show file tree
Hide file tree
Showing 13 changed files with 1,956 additions and 2,073 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/check-code.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node: [ 16, 18, 20 ]
node: [ 18, 20, 21 ]
name: Check Code (Node ${{ matrix.node }})

steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: 16
node-version: 18
cache: 'npm'
registry-url: 'https://registry.npmjs.org'

Expand Down
13 changes: 9 additions & 4 deletions __tests__/setup.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
import { readFileSync } from 'node:fs';
import { createRequire } from 'node:module';
import { dirname, resolve } from 'node:path';
import { fileURLToPath } from 'node:url';

import { initializeImageMagick } from '@imagemagick/magick-wasm';
import { createRequire } from 'module';
import { dirname } from 'path';
import { fileURLToPath } from 'url';

global.__filename = fileURLToPath(import.meta.url);
global.__dirname = dirname(__filename);
global.require = createRequire(import.meta.url);

await initializeImageMagick();
const wasmBytes = readFileSync(
resolve('node_modules/@imagemagick/magick-wasm/dist/magick.wasm'),
);
await initializeImageMagick(wasmBytes);
5 changes: 3 additions & 2 deletions __tests__/utils/getInsetAtGravity.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { readFileSync } from 'node:fs';

import { Gravity, ImageMagick } from '@imagemagick/magick-wasm';
import * as fs from 'fs';
import { describe, expect, it } from 'vitest';

import getInsetAtGravity from '../../src/utils/getInsetAtGravity';
Expand Down Expand Up @@ -61,7 +62,7 @@ describe('getInsetAtGravity', () => {
])('works as expected with %s', (_, file, gravity, expected) => {
let result: number | undefined = undefined;

ImageMagick.read(fs.readFileSync(`samples/input/${file}`), (image) => {
ImageMagick.read(readFileSync(`samples/input/${file}`), (image) => {
result = getInsetAtGravity(image, gravity as number);
});

Expand Down
Loading

0 comments on commit 080164f

Please sign in to comment.