Skip to content

Commit

Permalink
fix prettierignore file and run prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
sokra committed Feb 18, 2019
1 parent 75c2784 commit 75a9a51
Show file tree
Hide file tree
Showing 9 changed files with 236 additions and 249 deletions.
4 changes: 2 additions & 2 deletions .prettierignore
@@ -1,8 +1,8 @@
# Ignore test fixtures
test
test/*.*
!test/*.js
!test/**/webpack.config.js

# Ignore example fixtures
examples
examples/*.*
!examples/**/webpack.config.js
104 changes: 49 additions & 55 deletions test/BenchmarkTestCases.benchmark.js
Expand Up @@ -279,63 +279,57 @@ describe("BenchmarkTestCases", function() {
describe(`${testName} create benchmarks`, function() {
baselines.forEach(baseline => {
let baselineStats = null;
it(
`should benchmark ${baseline.name} (${baseline.rev})`,
function(done) {
const outputDirectory = path.join(
__dirname,
"js",
"benchmark",
`baseline-${baseline.name}`,
testName
);
const config =
Object.create(
require.requireActual(
path.join(testDirectory, "webpack.config.js")
)
) || {};
config.output = Object.create(config.output || {});
if (!config.context) config.context = testDirectory;
if (!config.output.path) config.output.path = outputDirectory;
runBenchmark(baseline.webpack, config, (err, stats) => {
if (err) return done(err);
process.stderr.write(` ${baseline.name} ${stats.text}`);
if (baseline.name === "HEAD") headStats = stats;
else baselineStats = stats;
done();
});
},
180000
);

it(
`should benchmark ${baseline.name} (${baseline.rev})`,
done => {
const outputDirectory = path.join(
__dirname,
"js",
"benchmark",
`baseline-${baseline.name}`,
testName
);
const config =
it(`should benchmark ${baseline.name} (${
baseline.rev
})`, function(done) {
const outputDirectory = path.join(
__dirname,
"js",
"benchmark",
`baseline-${baseline.name}`,
testName
);
const config =
Object.create(
require.requireActual(
path.join(testDirectory, "webpack.config.js")
) || {};
config.output = config.output || {};
if (!config.context) config.context = testDirectory;
if (!config.output.path) config.output.path = outputDirectory;
runBenchmark(baseline.webpack, config, (err, stats) => {
if (err) return done(err);
process.stderr.write(` ${baseline.name} ${stats.text}`);
if (baseline.name === "HEAD") headStats = stats;
else baselineStats = stats;
done();
});
},
180000
);
)
) || {};
config.output = Object.create(config.output || {});
if (!config.context) config.context = testDirectory;
if (!config.output.path) config.output.path = outputDirectory;
runBenchmark(baseline.webpack, config, (err, stats) => {
if (err) return done(err);
process.stderr.write(` ${baseline.name} ${stats.text}`);
if (baseline.name === "HEAD") headStats = stats;
else baselineStats = stats;
done();
});
}, 180000);

it(`should benchmark ${baseline.name} (${baseline.rev})`, done => {
const outputDirectory = path.join(
__dirname,
"js",
"benchmark",
`baseline-${baseline.name}`,
testName
);
const config =
require.requireActual(
path.join(testDirectory, "webpack.config.js")
) || {};
config.output = config.output || {};
if (!config.context) config.context = testDirectory;
if (!config.output.path) config.output.path = outputDirectory;
runBenchmark(baseline.webpack, config, (err, stats) => {
if (err) return done(err);
process.stderr.write(` ${baseline.name} ${stats.text}`);
if (baseline.name === "HEAD") headStats = stats;
else baselineStats = stats;
done();
});
}, 180000);

if (baseline.name !== "HEAD") {
it(`HEAD should not be slower than ${baseline.name} (${
Expand Down
4 changes: 2 additions & 2 deletions test/Compiler.test.js
Expand Up @@ -503,9 +503,9 @@ describe("Compiler", () => {
output: {
path: "/",
filename: "bundle.js"
},
}
});
compiler.hooks.failed.tap('CompilerTest', failedSpy);
compiler.hooks.failed.tap("CompilerTest", failedSpy);
compiler.outputFileSystem = new MemoryFs();
compiler.run((err, stats) => {
expect(err).toBeTruthy();
Expand Down
18 changes: 10 additions & 8 deletions test/SourceMapDevToolModuleOptionsPlugin.unittest.js
Expand Up @@ -58,14 +58,16 @@ describe("SourceMapDevToolModuleOptionsPlugin", () => {
});

describe("with line-to-line true", () => {
beforeEach(() =>
(eventBindings = applyPluginWithOptions(
SourceMapDevToolModuleOptionsPlugin,
{
module: false,
lineToLine: true
}
)));
beforeEach(
() =>
(eventBindings = applyPluginWithOptions(
SourceMapDevToolModuleOptionsPlugin,
{
module: false,
lineToLine: true
}
))
);

it("binds one event handler", () => {
expect(eventBindings.length).toBe(1);
Expand Down

0 comments on commit 75a9a51

Please sign in to comment.