Skip to content

Commit

Permalink
Update tests etc
Browse files Browse the repository at this point in the history
  • Loading branch information
btd committed Nov 17, 2017
1 parent 30235ab commit 53510e2
Show file tree
Hide file tree
Showing 4 changed files with 108 additions and 14 deletions.
103 changes: 99 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,12 @@
"name": "rollup-plugin-jst",
"version": "1.0.1",
"description": "",
"main": "dist/rollup-plugin-jst.cjs.js",
"scripts": {
"test": "mocha test/test.js"
},
"author": "Denis Bardadym <bardadymchik@gmail.com>",
"license": "MIT",
"jsnext:main": "src/index.js",
"main": "src/index.js",
"files": [
"src/",
"README.md"
Expand Down
4 changes: 2 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const { createFilter } = require("rollup-pluginutils");
const template = require("lodash/template");
const htmlMinifier = require("html-minifier");

export default function(options = {}) {
module.exports = function(options = {}) {
const filter = createFilter(options.include, options.exclude);

const extensions = options.extensions || [".html", ".ejs", ".jst"];
Expand Down Expand Up @@ -45,4 +45,4 @@ export default function(options = {}) {
`;
}
};
}
};
12 changes: 6 additions & 6 deletions test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,24 +14,24 @@ function executeBundle(bundle) {
}

describe("rollup-plugin-jst", () => {
it("compiles a component - escape", () => {
it("escape", () => {
return rollup({
input: "sample/a.ejs",
plugins: [jst()]
}).then(executeBundle);
});

it("compiles a component - noescape", () => {
it("noescape", () => {
return rollup({
input: "sample/b.ejs",
plugins: [jst()]
}).then(executeBundle);
});

it( 'compiles a component - htmlclean', () => {
it("htmlclean", () => {
return rollup({
entry: 'sample/c.ejs',
plugins: [ jst({ minify: true, minifyOptions: { collapseWhitespace: true } }) ]
}).then( executeBundle );
input: "sample/c.ejs",
plugins: [jst({ minify: true, minifyOptions: { collapseWhitespace: true } })]
}).then(executeBundle);
});
});

0 comments on commit 53510e2

Please sign in to comment.