Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
- run: npm run lint
- run: npm run lint:dts
- run: npm run test:ci
- run: npm run build
- run: npm run test:integration
- run: npm run benchmark
- name: Coveralls
uses: coverallsapp/github-action@master
Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,16 @@
"module": "index.mjs",
"scripts": {
"benchmark": "node benchmark",
"build": "rollup --config",
"build": "rollup --config --failAfterWarnings",
"clean": "rimraf dist",
"lint": "eslint --ignore-path .gitignore --ignore-pattern /examples/ .",
"lint:dts": "dtslint .",
"lint:fix": "npm run lint -- --fix",
"prepublishOnly": "npm run lint && npm run lint:dts && npm run test:ci && npm run clean && npm run build",
"release": "standard-version --no-verify",
"test": "jest --coverage",
"test": "jest --coverage --testPathIgnorePatterns test/integration/",
"test:ci": "npm test -- --ci",
"test:integration": "npm run build && jest test/integration/",
"test:watch": "npm test -- --watch"
},
"repository": {
Expand Down
26 changes: 26 additions & 0 deletions test/integration/index.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
describe.each([
['unminified', '../../dist/html-react-parser'],
['minified', '../../dist/html-react-parser.min']
])('UMD %s', (_type, path) => {
const parse = require(path);

it('exports the parser', () => {
expect(parse).toBeInstanceOf(Function);
});

it('exports default', () => {
expect(parse.default).toBeInstanceOf(Function);
});

it('exports domToReact', () => {
expect(parse.domToReact).toBeInstanceOf(Function);
});

it('exports htmlToDOM', () => {
expect(parse.htmlToDOM).toBeInstanceOf(Function);
});

it('exports attributesToProps', () => {
expect(parse.attributesToProps).toBeInstanceOf(Function);
});
});