Skip to content

Commit

Permalink
test: add jest image transformer
Browse files Browse the repository at this point in the history
  • Loading branch information
zhensherlock committed Jun 25, 2024
1 parent 8b16071 commit 1b75aec
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 4 deletions.
5 changes: 4 additions & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,8 @@ module.exports = {
},
collectCoverage: true,
coverageDirectory: 'coverage',
coverageReporters: ['json', 'lcov', 'text', 'clover']
coverageReporters: ['json', 'lcov', 'text', 'clover'],
transform: {
'\\.(jpg|jpeg|png|gif|svg)$': '<rootDir>/tests/transformer/image.transformer.ts'
}
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"lint": "npx eslint \"src/*.{ts,js}\"",
"dev": "concurrently \"npm run src:dev\" \"npm run docs:dev\"",
"src:dev": "rollup -c --watch",
"test": "jest",
"test": "jest --no-cache",
"build:types": "tsc",
"build": "npm run build:types && rollup -c --environment NODE_ENV:production",
"changelog": "conventional-changelog -p angular -i CHANGELOG.md -s -r 0 -n changelog-option.js",
Expand Down
Binary file added tests/assets/blind-watermark-decode-result.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 1 addition & 2 deletions tests/core/blind.test.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import { describe, expect, test } from '@jest/globals'
import { BlindWatermark } from '../../src/core/blind'
import $ from 'jquery'

const decodeImage = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAA+4AAAIkCAYAAACA4HHYAAAABmJLR0QA/wD/AP+gvaeTAAAgAElEQVR4nO3dybLbuBIFQPGF//+X+Ra22rIuBwAEyAKQGdGLvpYoilPVETgs67quLwAAACCk/z09AwAAAMA+wR0AAAACE9wBAAAgMMEdAAAAAhPcAQAAIDDBHQAAAAIT3AEAACAwwR0AAAACE9wBAAAgMMEdAAAAAhPcAQAAIDDB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DnRiAGMS/0AIlpWRxBgYN8jJQ55AKRQP4BIBHfogGviAABgXr+engFgm7AOAAC8Xq5xh5CEdgAA4M2IOwQisAMAAN+MuEMQQjsAALBFcIcAhHYAAGCP4A4AAACBCe7wMKPtAADAEcEdHiS0AwAAZwR3AAAACOz/FImDJfIRLagAAAAASUVORK5CYII='
import decodeImage from '../assets/blind-watermark-decode-result.png'

describe('core blind module', () => {
test('blind-watermark create expected true', async () => {
Expand Down
4 changes: 4 additions & 0 deletions tests/declarations.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
declare module '*.png';
declare module '*.jpg';
declare module '*.jpeg';
declare module '*.gif';
16 changes: 16 additions & 0 deletions tests/transformer/image.transformer.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
const fs = require('fs')
const path = require('path')

const fileToBase64 = (filePath) => {
const absolutePath = path.resolve(__dirname, filePath)
const file = fs.readFileSync(absolutePath)
return Buffer.from(file).toString('base64')
}

module.exports = {
process: (sourceText, sourcePath) => {
return {
code: `module.exports = 'data:image/png;base64,${fileToBase64(sourcePath)}'`
}
}
}

0 comments on commit 1b75aec

Please sign in to comment.