Skip to content

Commit 164c316

Browse files
committed
refactor(ES6): Examples.test.js
1 parent d9ac043 commit 164c316

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

test/Examples.test.js

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
1+
"use strict";
2+
13
/* globals describe it */
24
require("should");
3-
var path = require("path");
4-
var fs = require("fs");
5-
var webpack = require("../");
5+
const path = require("path");
6+
const fs = require("fs");
7+
const webpack = require("../");
68

7-
describe("Examples", function() {
8-
var examples = fs.readdirSync(path.join(__dirname, "..", "examples")).map(function(name) {
9-
return path.join(__dirname, "..", "examples", name);
10-
}).filter(function(p) {
11-
return fs.statSync(p).isDirectory() && fs.existsSync(path.join(p, "build.js"));
12-
});
9+
describe("Examples", () => {
10+
const examples = fs.readdirSync(path.join(__dirname, "..", "examples")).map((name) =>
11+
path.join(__dirname, "..", "examples", name)).filter((p) =>
12+
fs.statSync(p).isDirectory() && fs.existsSync(path.join(p, "build.js")));
1313

14-
examples.forEach(function(examplePath) {
14+
examples.forEach((examplePath) => {
1515
it("should compile " + path.basename(examplePath), function(done) {
1616
this.timeout(20000);
17-
var options = {};
18-
var webpackConfigPath = path.join(examplePath, "webpack.config.js");
17+
let options = {};
18+
let webpackConfigPath = path.join(examplePath, "webpack.config.js");
1919
webpackConfigPath = webpackConfigPath.substr(0, 1).toUpperCase() + webpackConfigPath.substr(1);
2020
if(fs.existsSync(webpackConfigPath))
2121
options = require(webpackConfigPath);
@@ -35,7 +35,7 @@ describe("Examples", function() {
3535
if(!options.entry)
3636
options.entry = "./example.js";
3737
}
38-
webpack(options, function(err, stats) {
38+
webpack(options, (err, stats) => {
3939
if(err) return done(err);
4040
stats = stats.toJson({
4141
errorDetails: true

0 commit comments

Comments
 (0)