diff --git a/package.json b/package.json index e164479..344d33f 100644 --- a/package.json +++ b/package.json @@ -95,7 +95,7 @@ "immer": "^9.0.19", "immutable": "^4.0.0", "jest": "^29.4.0", - "jsdoc-tests": "^0.1.1", + "jsdoc-tests": "^1.1.0", "json2csv": "^5.0.7", "lodash": "^4.17.21", "prettier": "^2.5.1", diff --git a/test/jsdoc.test.ts b/test/jsdoc.test.ts index dbcc5f7..56a8739 100644 --- a/test/jsdoc.test.ts +++ b/test/jsdoc.test.ts @@ -2,18 +2,21 @@ import { jsdocTests } from 'jsdoc-tests'; describe('jsdoc', () => { test('create()', () => { - jsdocTests('../src/create.ts', __dirname, require); + jsdocTests('../src/create.ts', __dirname); }); test('apply()', () => { - jsdocTests('../src/apply.ts', __dirname, require); + jsdocTests('../src/apply.ts', __dirname); }); test('current()', () => { - jsdocTests('../src/current.ts', __dirname, require); + jsdocTests('../src/current.ts', __dirname); }); test('original()', () => { - jsdocTests('../src/original.ts', __dirname, require); + jsdocTests('../src/original.ts', __dirname); }); test('unsafe()', () => { - jsdocTests('../src/unsafe.ts', __dirname, require); + jsdocTests('../src/unsafe.ts', __dirname); + }); + test('rawReturn()', () => { + jsdocTests('../src/rawReturn.ts', __dirname); }); }); diff --git a/test/rawReturn.0.snap.ts b/test/rawReturn.0.snap.ts new file mode 100644 index 0000000..c6e89f3 --- /dev/null +++ b/test/rawReturn.0.snap.ts @@ -0,0 +1,10 @@ +import { create, rawReturn } from '../index'; + +const baseState = { foo: { bar: 'str' }, arr: [] }; +const state = create( + baseState, + (draft) => { + return rawReturn(baseState); + }, +); +expect(state).toBe(baseState); diff --git a/yarn.lock b/yarn.lock index d97f99c..b41b567 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6347,10 +6347,10 @@ jsbn@~0.1.0: resolved "https://registry.yarnpkg.com/jsbn/-/jsbn-0.1.1.tgz#a5e654c2e5a2deb5f201d96cefbca80c0ef2f513" integrity sha512-UVU9dibq2JcFWxQPA6KCqj5O42VOmAY3zQUfEKxU0KpTGXwNoCjkX1e13eHNvw/xPynt6pU0rZ1htjWTNTSXsg== -jsdoc-tests@^0.1.1: - version "0.1.1" - resolved "https://registry.yarnpkg.com/jsdoc-tests/-/jsdoc-tests-0.1.1.tgz#c5f9c25b365a599c3830f5b21fb2b07146485612" - integrity sha512-l6IflN82QMMlLX9/RBcdYFWnmZl3FnXe2kPl8S4DldHrt6AlsEkD7iQnPEerEpbx0IQhjAKM52kiD6YUeOp5JA== +jsdoc-tests@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/jsdoc-tests/-/jsdoc-tests-1.1.0.tgz#e353b65f284df07d1ff15ca1a43be951bce1c5fd" + integrity sha512-kXWJm517vOlAHResJ813eyDpC32pGsfOfzlx+2ftJAAsiAp6eSBdiOBEU6Oa5PDALR+FmOc8WJ2kYRYgT35isw== dependencies: "@babel/parser" "^7.12.7" markdown-it "^12.0.2"