Skip to content

Commit

Permalink
add test to make sure browser build works as commonJS module
Browse files Browse the repository at this point in the history
  • Loading branch information
joshgoebel committed Apr 26, 2020
1 parent 06f1556 commit 5b7cbd3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,7 @@ script:
npm run test
else
npm run test-browser
# our browser build should also work fine as a Node.js CommonJS module
node test/builds/browser_build_as_commonjs.js
fi
sudo: false # Use container-based architecture
6 changes: 6 additions & 0 deletions test/builds/browser_build_as_commonjs.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
const hljs = require("../../build/highlight");

let major = parseInt(majorVersion=hljs.versionString.split("."))
if (major != 10) {
process.exit(1)
}

0 comments on commit 5b7cbd3

Please sign in to comment.