Skip to content

Commit 2659967

Browse files
test(integration): add tests for UMD bundle
1 parent 223bdec commit 2659967

File tree

2 files changed

+28
-1
lines changed

2 files changed

+28
-1
lines changed

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,9 @@
1414
"lint:fix": "npm run lint -- --fix",
1515
"prepublishOnly": "npm run lint && npm run lint:dts && npm run test:ci && npm run clean && npm run build",
1616
"release": "standard-version --no-verify",
17-
"test": "jest --coverage",
17+
"test": "jest --coverage --testPathIgnorePatterns test/integration/",
1818
"test:ci": "npm test -- --ci",
19+
"test:integration": "npm run build && jest test/integration/",
1920
"test:watch": "npm test -- --watch"
2021
},
2122
"repository": {

test/integration/index.test.js

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
describe.each([
2+
['unminified', '../../dist/html-react-parser'],
3+
['minified', '../../dist/html-react-parser.min']
4+
])('UMD %s', (_type, path) => {
5+
const parse = require(path);
6+
7+
it('exports the parser', () => {
8+
expect(parse).toBeInstanceOf(Function);
9+
});
10+
11+
it('exports default', () => {
12+
expect(parse.default).toBeInstanceOf(Function);
13+
});
14+
15+
it('exports domToReact', () => {
16+
expect(parse.domToReact).toBeInstanceOf(Function);
17+
});
18+
19+
it('exports htmlToDOM', () => {
20+
expect(parse.htmlToDOM).toBeInstanceOf(Function);
21+
});
22+
23+
it('exports attributesToProps', () => {
24+
expect(parse.attributesToProps).toBeInstanceOf(Function);
25+
});
26+
});

0 commit comments

Comments
 (0)