Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
bmesuere committed Jun 20, 2024
1 parent a0a7215 commit 0eea6d4
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion jest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ const config: Config = {
// notifyMode: "failure-change",

// A preset that is used as a base for Jest's configuration
// preset: undefined,
preset: 'ts-jest/presets/default-esm',

// Run tests from one or more projects
// projects: undefined,
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"scripts": {
"build": "yarn run tsc",
"lint": "yarn run eslint",
"test": "yarn run jest",
"test": "NODE_OPTIONS='--experimental-vm-modules --no-warnings' yarn run jest",
"typecheck": "yarn tsc --skipLibCheck --noEmit",
"peptfilter": "yarn run tsx bin/peptfilter.ts",
"uniprot": "yarn run tsx bin/uniprot.ts"
Expand Down
8 changes: 4 additions & 4 deletions tests/commands/peptfilter.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Peptfilter } from '../../lib/commands/peptfilter';
import { jest } from '@jest/globals';
import * as mock from 'mock-stdin';

let output: string[];
Expand Down Expand Up @@ -54,9 +55,8 @@ test('test default filter from stdin', async () => {

await run;

expect(writeSpy).toHaveBeenCalledTimes(1);
expect(errorSpy).toHaveBeenCalledTimes(0);
expect(output.length).toBe(1);
expect(output.join("").trimEnd().split("\n").length).toBe(1);
});

test('test if it passes fasta from stdin', async () => {
Expand All @@ -71,8 +71,8 @@ test('test if it passes fasta from stdin', async () => {

await run;

expect(writeSpy).toHaveBeenCalledTimes(1);
expect(errorSpy).toHaveBeenCalledTimes(0);
expect(output.join("").trimEnd().split("\n").length).toBe(1);
expect(output[0]).toBe(">AA\n");
});

Expand All @@ -92,7 +92,7 @@ test('test complex example from stdin', async () => {

await run;

expect(writeSpy).toHaveBeenCalledTimes(1);
expect(errorSpy).toHaveBeenCalledTimes(0);
expect(output.join("").trimEnd().split("\n").length).toBe(1);
expect(output[0]).toBe("CCCCCA\n");
});
1 change: 1 addition & 0 deletions tests/commands/uniprot.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Uniprot } from '../../lib/commands/uniprot';
import { jest } from '@jest/globals';
import * as mock from 'mock-stdin';

let output: string[];
Expand Down

0 comments on commit 0eea6d4

Please sign in to comment.