File tree Expand file tree Collapse file tree 13 files changed +58
-244
lines changed
Expand file tree Collapse file tree 13 files changed +58
-244
lines changed Original file line number Diff line number Diff line change 11import { test } from "bun:test" ;
22import { convert } from "../../src/converters/assimp.ts" ;
3- import {
4- runConvertFailTest ,
5- runConvertLogsStderror ,
6- runConvertLogsStderrorAndStdout ,
7- runConvertSuccessTest ,
8- } from "./helpers/converters.ts" ;
3+ import { runCommonTests } from "./helpers/commonTests.ts" ;
94
10- test ( "convert resolves when execFile succeeds" , async ( ) => {
11- await runConvertSuccessTest ( convert ) ;
12- } ) ;
5+ runCommonTests ( convert ) ;
136
14- test ( "convert rejects when execFile fails" , async ( ) => {
15- await runConvertFailTest ( convert ) ;
16- } ) ;
17-
18- test ( "convert logs stderr when present" , async ( ) => {
19- await runConvertLogsStderror ( convert ) ;
20- } ) ;
21-
22- test ( "convert logs both stderr and stdout when present" , async ( ) => {
23- await runConvertLogsStderrorAndStdout ( convert ) ;
24- } ) ;
7+ test . skip ( "dummy - required to trigger test detection" , ( ) => { } ) ;
Original file line number Diff line number Diff line change 11import { test } from "bun:test" ;
22import { convert } from "../../src/converters/calibre.ts" ;
3- import {
4- runConvertFailTest ,
5- runConvertLogsStderror ,
6- runConvertLogsStderrorAndStdout ,
7- runConvertSuccessTest ,
8- } from "./helpers/converters.ts" ;
3+ import { runCommonTests } from "./helpers/commonTests.ts" ;
94
10- test ( "convert resolves when execFile succeeds" , async ( ) => {
11- await runConvertSuccessTest ( convert ) ;
12- } ) ;
5+ runCommonTests ( convert ) ;
136
14- test ( "convert rejects when execFile fails" , async ( ) => {
15- await runConvertFailTest ( convert ) ;
16- } ) ;
17-
18- test ( "convert logs stderr when present" , async ( ) => {
19- await runConvertLogsStderror ( convert ) ;
20- } ) ;
21-
22- test ( "convert logs both stderr and stdout when present" , async ( ) => {
23- await runConvertLogsStderrorAndStdout ( convert ) ;
24- } ) ;
7+ test . skip ( "dummy - required to trigger test detection" , ( ) => { } ) ;
Original file line number Diff line number Diff line change @@ -2,34 +2,15 @@ import type { ExecFileException } from "node:child_process";
22import { beforeEach , expect , test } from "bun:test" ;
33import { convert } from "../../src/converters/dvisvgm.ts" ;
44import { ExecFileFn } from "../../src/converters/types.ts" ;
5- import {
6- runConvertFailTest ,
7- runConvertLogsStderror ,
8- runConvertLogsStderrorAndStdout ,
9- runConvertSuccessTest ,
10- } from "./helpers/converters.ts" ;
5+ import { runCommonTests } from "./helpers/commonTests.ts" ;
116
127let calls : string [ ] [ ] = [ ] ;
138
149beforeEach ( ( ) => {
1510 calls = [ ] ;
1611} ) ;
1712
18- test ( "convert resolves when execFile succeeds" , async ( ) => {
19- await runConvertSuccessTest ( convert ) ;
20- } ) ;
21-
22- test ( "convert rejects when execFile fails" , async ( ) => {
23- await runConvertFailTest ( convert ) ;
24- } ) ;
25-
26- test ( "convert logs stderr when present" , async ( ) => {
27- await runConvertLogsStderror ( convert ) ;
28- } ) ;
29-
30- test ( "convert logs both stderr and stdout when present" , async ( ) => {
31- await runConvertLogsStderrorAndStdout ( convert ) ;
32- } ) ;
13+ runCommonTests ( convert ) ;
3314
3415test ( "convert respects eps filetype" , async ( ) => {
3516 const originalConsoleLog = console . log ;
Original file line number Diff line number Diff line change 11import { test } from "bun:test" ;
22import { convert } from "../../src/converters/graphicsmagick.ts" ;
3- import {
4- runConvertFailTest ,
5- runConvertLogsStderror ,
6- runConvertLogsStderrorAndStdout ,
7- runConvertSuccessTest ,
8- } from "./helpers/converters.ts" ;
3+ import { runCommonTests } from "./helpers/commonTests.ts" ;
94
10- test ( "convert resolves when execFile succeeds" , async ( ) => {
11- await runConvertSuccessTest ( convert ) ;
12- } ) ;
5+ runCommonTests ( convert ) ;
136
14- test ( "convert rejects when execFile fails" , async ( ) => {
15- await runConvertFailTest ( convert ) ;
16- } ) ;
17-
18- test ( "convert logs stderr when present" , async ( ) => {
19- await runConvertLogsStderror ( convert ) ;
20- } ) ;
21-
22- test ( "convert logs both stderr and stdout when present" , async ( ) => {
23- await runConvertLogsStderrorAndStdout ( convert ) ;
24- } ) ;
7+ test . skip ( "dummy - required to trigger test detection" , ( ) => { } ) ;
Original file line number Diff line number Diff line change 1+ import { test } from "bun:test" ;
2+ import { ConvertFnWithExecFile } from "../../../src/converters/types.ts" ;
3+ import {
4+ runConvertFailTest ,
5+ runConvertLogsStderror ,
6+ runConvertLogsStderrorAndStdout ,
7+ runConvertSuccessTest ,
8+ } from "./converters.ts" ;
9+
10+ export function runCommonTests ( convert : ConvertFnWithExecFile ) {
11+ test ( "convert resolves when execFile succeeds" , async ( ) => {
12+ await runConvertSuccessTest ( convert ) ;
13+ } ) ;
14+
15+ test ( "convert rejects when execFile fails" , async ( ) => {
16+ await runConvertFailTest ( convert ) ;
17+ } ) ;
18+
19+ test ( "convert logs stderr when present" , async ( ) => {
20+ await runConvertLogsStderror ( convert ) ;
21+ } ) ;
22+
23+ test ( "convert logs both stderr and stdout when present" , async ( ) => {
24+ await runConvertLogsStderrorAndStdout ( convert ) ;
25+ } ) ;
26+ }
Original file line number Diff line number Diff line change @@ -2,34 +2,15 @@ import type { ExecFileException } from "node:child_process";
22import { beforeEach , expect , test } from "bun:test" ;
33import { convert } from "../../src/converters/imagemagick.ts" ;
44import { ExecFileFn } from "../../src/converters/types.ts" ;
5- import {
6- runConvertFailTest ,
7- runConvertLogsStderror ,
8- runConvertLogsStderrorAndStdout ,
9- runConvertSuccessTest ,
10- } from "./helpers/converters.ts" ;
5+ import { runCommonTests } from "./helpers/commonTests.ts" ;
116
127let calls : string [ ] [ ] = [ ] ;
138
149beforeEach ( ( ) => {
1510 calls = [ ] ;
1611} ) ;
1712
18- test ( "convert resolves when execFile succeeds" , async ( ) => {
19- await runConvertSuccessTest ( convert ) ;
20- } ) ;
21-
22- test ( "convert rejects when execFile fails" , async ( ) => {
23- await runConvertFailTest ( convert ) ;
24- } ) ;
25-
26- test ( "convert logs stderr when present" , async ( ) => {
27- await runConvertLogsStderror ( convert ) ;
28- } ) ;
29-
30- test ( "convert logs both stderr and stdout when present" , async ( ) => {
31- await runConvertLogsStderrorAndStdout ( convert ) ;
32- } ) ;
13+ runCommonTests ( convert ) ;
3314
3415test ( "convert respects ico conversion target type" , async ( ) => {
3516 const originalConsoleLog = console . log ;
Original file line number Diff line number Diff line change 11import { test } from "bun:test" ;
22import { convert } from "../../src/converters/inkscape.ts" ;
3- import {
4- runConvertFailTest ,
5- runConvertLogsStderror ,
6- runConvertLogsStderrorAndStdout ,
7- runConvertSuccessTest ,
8- } from "./helpers/converters.ts" ;
3+ import { runCommonTests } from "./helpers/commonTests.ts" ;
94
10- test ( "convert resolves when execFile succeeds" , async ( ) => {
11- await runConvertSuccessTest ( convert ) ;
12- } ) ;
5+ runCommonTests ( convert ) ;
136
14- test ( "convert rejects when execFile fails" , async ( ) => {
15- await runConvertFailTest ( convert ) ;
16- } ) ;
17-
18- test ( "convert logs stderr when present" , async ( ) => {
19- await runConvertLogsStderror ( convert ) ;
20- } ) ;
21-
22- test ( "convert logs both stderr and stdout when present" , async ( ) => {
23- await runConvertLogsStderrorAndStdout ( convert ) ;
24- } ) ;
7+ test . skip ( "dummy - required to trigger test detection" , ( ) => { } ) ;
Original file line number Diff line number Diff line change 11import { test } from "bun:test" ;
22import { convert } from "../../src/converters/libheif.ts" ;
3- import {
4- runConvertFailTest ,
5- runConvertLogsStderror ,
6- runConvertLogsStderrorAndStdout ,
7- runConvertSuccessTest ,
8- } from "./helpers/converters.ts" ;
3+ import { runCommonTests } from "./helpers/commonTests.ts" ;
94
10- test ( "convert resolves when execFile succeeds" , async ( ) => {
11- await runConvertSuccessTest ( convert ) ;
12- } ) ;
5+ runCommonTests ( convert ) ;
136
14- test ( "convert rejects when execFile fails" , async ( ) => {
15- await runConvertFailTest ( convert ) ;
16- } ) ;
17-
18- test ( "convert logs stderr when present" , async ( ) => {
19- await runConvertLogsStderror ( convert ) ;
20- } ) ;
21-
22- test ( "convert logs both stderr and stdout when present" , async ( ) => {
23- await runConvertLogsStderrorAndStdout ( convert ) ;
24- } ) ;
7+ test . skip ( "dummy - required to trigger test detection" , ( ) => { } ) ;
Original file line number Diff line number Diff line change @@ -2,34 +2,15 @@ import type { ExecFileException } from "node:child_process";
22import { beforeEach , expect , test } from "bun:test" ;
33import { convert } from "../../src/converters/libjxl.ts" ;
44import { ExecFileFn } from "../../src/converters/types.ts" ;
5- import {
6- runConvertFailTest ,
7- runConvertLogsStderror ,
8- runConvertLogsStderrorAndStdout ,
9- runConvertSuccessTest ,
10- } from "./helpers/converters.ts" ;
5+ import { runCommonTests } from "./helpers/commonTests.ts" ;
116
127let command : string = "" ;
138
149beforeEach ( ( ) => {
1510 command = "" ;
1611} ) ;
1712
18- test ( "convert resolves when execFile succeeds" , async ( ) => {
19- await runConvertSuccessTest ( convert ) ;
20- } ) ;
21-
22- test ( "convert rejects when execFile fails" , async ( ) => {
23- await runConvertFailTest ( convert ) ;
24- } ) ;
25-
26- test ( "convert logs stderr when present" , async ( ) => {
27- await runConvertLogsStderror ( convert ) ;
28- } ) ;
29-
30- test ( "convert logs both stderr and stdout when present" , async ( ) => {
31- await runConvertLogsStderrorAndStdout ( convert ) ;
32- } ) ;
13+ runCommonTests ( convert ) ;
3314
3415test ( "convert uses djxl with input filetype being jxl" , async ( ) => {
3516 const originalConsoleLog = console . log ;
Original file line number Diff line number Diff line change 11import { test } from "bun:test" ;
22import { convert } from "../../src/converters/potrace.ts" ;
3- import {
4- runConvertFailTest ,
5- runConvertLogsStderror ,
6- runConvertLogsStderrorAndStdout ,
7- runConvertSuccessTest ,
8- } from "./helpers/converters.ts" ;
3+ import { runCommonTests } from "./helpers/commonTests.ts" ;
94
10- test ( "convert resolves when execFile succeeds" , async ( ) => {
11- await runConvertSuccessTest ( convert ) ;
12- } ) ;
5+ runCommonTests ( convert ) ;
136
14- test ( "convert rejects when execFile fails" , async ( ) => {
15- await runConvertFailTest ( convert ) ;
16- } ) ;
17-
18- test ( "convert logs stderr when present" , async ( ) => {
19- await runConvertLogsStderror ( convert ) ;
20- } ) ;
21-
22- test ( "convert logs both stderr and stdout when present" , async ( ) => {
23- await runConvertLogsStderrorAndStdout ( convert ) ;
24- } ) ;
7+ test . skip ( "dummy - required to trigger test detection" , ( ) => { } ) ;
You can’t perform that action at this time.
0 commit comments