Skip to content

Commit

Permalink
Add test for ES module
Browse files Browse the repository at this point in the history
  • Loading branch information
carhartl committed Sep 7, 2019
1 parent 049f92a commit 1657ae5
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 0 deletions.
1 change: 1 addition & 0 deletions Gruntfile.js
Expand Up @@ -29,6 +29,7 @@ module.exports = function (grunt) {
options: {
urls: [
'http://127.0.0.1:9998/',
'http://127.0.0.1:9998/module.html',
'http://127.0.0.1:9998/encoding.html?integration_baseurl=http://127.0.0.1:9998/'
]
}
Expand Down
14 changes: 14 additions & 0 deletions test/module.html
@@ -0,0 +1,14 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>JavaScript Cookie Test Suite - ES module</title>
<link href="../node_modules/qunit/qunit/qunit.css" rel="stylesheet">
<script src="../node_modules/qunit/qunit/qunit.js" defer></script>
<script type="module" src="module.mjs"></script>
</head>
<body>
<div id="qunit"></div>
<div id="qunit-fixture"></div>
</body>
</html>
6 changes: 6 additions & 0 deletions test/module.mjs
@@ -0,0 +1,6 @@
import Cookies from "../dist/js.cookie.min.mjs";

QUnit.test("default export", function(test) {
test.expect(1);
test.ok(!!Cookies.get, "should provide API");
});

0 comments on commit 1657ae5

Please sign in to comment.