Skip to content

Commit

Permalink
Move sources to lib, and add typed jestExpect export
Browse files Browse the repository at this point in the history
  • Loading branch information
mshima committed Sep 26, 2022
1 parent cdeb2f9 commit 82550bb
Show file tree
Hide file tree
Showing 7 changed files with 490 additions and 493 deletions.
2 changes: 1 addition & 1 deletion .mocharc.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"require": ["./index.js", "./image.js"]
"require": ["./lib/index.js", "./lib/image.js"]
}
File renamed without changes.
1 change: 1 addition & 0 deletions lib/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from '@jest/expect';
4 changes: 4 additions & 0 deletions index.js → lib/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
const chalk = require('chalk');
const { expect } = require('expect');
const {
addSerializer,
toMatchSnapshot,
toMatchInlineSnapshot,
toThrowErrorMatchingInlineSnapshot,
Expand All @@ -9,6 +10,8 @@ const {
SnapshotState,
} = require('jest-snapshot');

expect.addSnapshotSerializer = addSerializer;

const { extend, setState } = expect;

/** @type {import('jest-snapshot').SnapshotResolver} */
Expand Down Expand Up @@ -231,4 +234,5 @@ module.exports = {
setSnapshotStateOptions,
getSnapshotStateOptions,
mochaHooks,
jestSpect: expect,
};
Loading

0 comments on commit 82550bb

Please sign in to comment.