Skip to content

Commit

Permalink
test(jsdoc): update jsdoc testing
Browse files Browse the repository at this point in the history
  • Loading branch information
unadlib committed Mar 26, 2023
1 parent 8fff243 commit 5cb1885
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 10 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
13 changes: 8 additions & 5 deletions test/jsdoc.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
});
10 changes: 10 additions & 0 deletions test/rawReturn.0.snap.ts
Original file line number Diff line number Diff line change
@@ -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);
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 5cb1885

Please sign in to comment.