Merge pull request #3672 from alistairjcbrown/update-noncalling-typechecks

Update missing should type check calls
This commit is contained in:
Tobias Koppers 2017-01-02 09:09:23 +01:00 committed by GitHub
commit 849385afdb
13 changed files with 68 additions and 68 deletions

View File

@ -56,7 +56,7 @@ describe("Compiler (caching)", function() {
});
should.strictEqual(typeof stats, "object");
stats.should.have.property("errors");
Array.isArray(stats.errors).should.be.ok;
Array.isArray(stats.errors).should.be.ok();
if(options.expectErrors) {
stats.errors.length.should.be.eql(options.expectErrors);
} else {

View File

@ -46,7 +46,7 @@ describe("Compiler", function() {
});
should.strictEqual(typeof stats, "object");
stats.should.have.property("errors");
Array.isArray(stats.errors).should.be.ok;
Array.isArray(stats.errors).should.be.ok();
if(stats.errors.length > 0) {
stats.errors[0].should.be.instanceOf(Error);
throw stats.errors[0];

View File

@ -35,8 +35,8 @@ describe("Errors", function() {
should.strictEqual(typeof stats, "object");
stats.should.have.property("errors");
stats.should.have.property("warnings");
Array.isArray(stats.errors).should.be.ok; // eslint-disable-line no-unused-expressions
Array.isArray(stats.warnings).should.be.ok; // eslint-disable-line no-unused-expressions
Array.isArray(stats.errors).should.be.ok(); // eslint-disable-line no-unused-expressions
Array.isArray(stats.warnings).should.be.ok(); // eslint-disable-line no-unused-expressions
callback(stats.errors, stats.warnings);
});
}

View File

@ -18,8 +18,8 @@ describe("Integration", function() {
}
}, function(err, stats) {
if(err) throw err;
stats.hasErrors().should.be.not.ok;
stats.hasWarnings().should.be.not.ok;
stats.hasErrors().should.be.not.ok();
stats.hasWarnings().should.be.not.ok();
done();
});
});
@ -86,8 +86,8 @@ describe("Integration", function() {
]
}, function(err, stats) {
if(err) throw err;
stats.hasErrors().should.be.not.ok;
stats.hasWarnings().should.be.not.ok;
stats.hasErrors().should.be.not.ok();
stats.hasWarnings().should.be.not.ok();
done();
});
});

View File

@ -22,8 +22,8 @@ describe("NodeTemplatePlugin", function() {
]
}, function(err, stats) {
if(err) return err;
stats.hasErrors().should.be.not.ok;
stats.hasWarnings().should.be.not.ok;
stats.hasErrors().should.be.not.ok();
stats.hasWarnings().should.be.not.ok();
var result = require("./js/result").abc;
result.nextTick.should.be.equal(process.nextTick);
result.fs.should.be.equal(require("fs"));
@ -60,7 +60,7 @@ describe("NodeTemplatePlugin", function() {
]
}, function(err, stats) {
if(err) return err;
stats.hasErrors().should.be.not.ok;
stats.hasErrors().should.be.not.ok();
var result = require("./js/result2");
result.nextTick.should.be.equal(process.nextTick);
result.fs.should.be.equal(require("fs"));

View File

@ -104,14 +104,14 @@ describe("Stats", function() {
errors: ['firstError'],
hash: '1234'
});
mockStats.hasErrors().should.be.ok;
mockStats.hasErrors().should.be.ok();
});
it("hasWarnings", function() {
var mockStats = new Stats({
warnings: ['firstError'],
hash: '1234'
});
mockStats.hasWarnings().should.be.ok;
mockStats.hasWarnings().should.be.ok();
});
});
describe("does not have", function() {
@ -120,14 +120,14 @@ describe("Stats", function() {
errors: [],
hash: '1234'
});
mockStats.hasErrors().should.not.be.ok;
mockStats.hasErrors().should.not.be.ok();
});
it("hasWarnings", function() {
var mockStats = new Stats({
warnings: [],
hash: '1234'
});
mockStats.hasWarnings().should.not.be.ok;
mockStats.hasWarnings().should.not.be.ok();
});
});
it("formatError handles string errors", function() {

View File

@ -13,7 +13,7 @@ it("should handle named chunks", function(done) {
require.ensure([], function(require) {
require("./empty?c");
require("./empty?d");
sync.should.be.ok;
sync.should.be.ok();
done();
}, "named-chunk");
}
@ -22,10 +22,10 @@ it("should handle named chunks", function(done) {
it("should handle empty named chunks", function(done) {
var sync = false;
require.ensure([], function(require) {
sync.should.be.ok;
sync.should.be.ok();
}, "empty-named-chunk");
require.ensure([], function(require) {
sync.should.be.ok;
sync.should.be.ok();
done();
}, "empty-named-chunk");
sync = true;

View File

@ -41,5 +41,5 @@ it("should parse template strings in require.resolve", function() {
// Arbitrary assertion; can't use .ok() as it could be 0,
// can't use typeof as that depends on webpack config.
require.resolve(`./sync/${name}Test`).should.not.be.undefined;
require.resolve(`./sync/${name}Test`).should.not.be.undefined();
})

View File

@ -9,7 +9,7 @@ it("should not produce a SourceMap for vendors chunk", function() {
var fs = require("fs"),
path = require("path"),
assert = require("assert");
fs.existsSync(path.join(__dirname, "vendors.js.map")).should.be.false;
fs.existsSync(path.join(__dirname, "vendors.js.map")).should.be.false();
});
require.include("./test.js");

View File

@ -1,7 +1,7 @@
require("should");
it("should provide a global Buffer shim", function () {
Buffer.should.be.a.Function;
Buffer.should.be.a.Function();
});
it("should provide the buffer module", function () {

View File

@ -1,7 +1,7 @@
require("should");
it("should provide a global Buffer shim", function () {
Buffer.should.be.a.Function;
Buffer.should.be.a.Function();
});
it("should fail on the buffer module"/*, function () {

View File

@ -5,95 +5,95 @@ global.XMLHttpRequest = function() {};
global.XMLHttpRequest.prototype.open = function() {};
it("should provide a global Buffer constructor", function() {
Buffer.should.be.a.Function;
Buffer.should.be.a.Function();
});
// Webpack is not providing a console shim by default
// @see lib/WebpackOptionsDefaulter.js
// Uncomment this when defaults are changed
//it("should provide a global console shim", function () {
// console.should.be.an.Object;
// console.time.should.be.a.Function;
// console.should.be.an.Object();
// console.time.should.be.a.Function();
//});
it("should provide a global process shim", function () {
process.should.be.an.Object;
process.should.be.an.Object();
});
it("should provide a global setImmediate shim", function () {
setImmediate.should.be.a.Function;
setImmediate.should.be.a.Function();
});
it("should provide a global clearImmediate shim", function () {
clearImmediate.should.be.a.Function;
clearImmediate.should.be.a.Function();
});
it("should provide an assert shim", function () {
require("assert").should.be.a.Function;
require("assert").should.be.a.Function();
});
it("should provide a util shim", function () {
require("util").should.be.an.Object;
require("util").should.be.an.Object();
});
it("should provide a buffer shim", function () {
require("buffer").should.be.an.Object;
require("buffer").should.be.an.Object();
});
it("should provide a crypto shim", function () {
require("crypto").should.be.an.Object;
require("crypto").should.be.an.Object();
});
it("should provide a domain shim", function () {
require("domain").should.be.an.Object;
require("domain").should.be.an.Object();
});
it("should provide an events shim", function () {
require("events").should.be.a.Function;
require("events").should.be.a.Function();
});
it("should provide an http shim", function () {
require("http").should.be.an.Object;
require("http").should.be.an.Object();
});
it("should provide an https shim", function () {
require("https").should.be.an.Object;
require("https").should.be.an.Object();
});
it("should provide an os shim", function () {
require("os").should.be.an.Object;
require("os").should.be.an.Object();
});
it("should provide a path shim", function () {
require("path").should.be.an.Object;
require("path").should.be.an.Object();
});
it("should provide a punycode shim", function () {
require("punycode").should.be.an.Object;
require("punycode").should.be.an.Object();
});
it("should provide a stream shim", function () {
require("stream").should.be.a.Function;
require("stream").should.be.a.Function();
});
it("should provide a tty shim", function () {
require("tty").should.be.an.Object;
require("tty").should.be.an.Object();
});
it("should provide a url shim", function () {
require("url").should.be.an.Object;
require("url").should.be.an.Object();
});
it("should provide a util shim", function () {
require("util").should.be.an.Object;
require("util").should.be.an.Object();
});
it("should provide a vm shim", function () {
require("vm").should.be.an.Object;
require("vm").should.be.an.Object();
});
it("should provide a zlib shim", function () {
require("zlib").should.be.an.Object;
require("zlib").should.be.an.Object();
});
it("should provide a shim for a path in a build-in module", function () {

View File

@ -5,92 +5,92 @@ global.XMLHttpRequest = function() {};
global.XMLHttpRequest.prototype.open = function() {};
it("should provide a global Buffer constructor", function() {
Buffer.should.be.a.Function;
Buffer.should.be.a.Function();
});
it("should provide a global console shim", function () {
console.should.be.an.Object;
console.time.should.be.a.Function;
console.should.be.an.Object();
console.time.should.be.a.Function();
});
it("should provide a global process shim", function () {
process.should.be.an.Object;
process.should.be.an.Object();
});
it("should provide a global setImmediate shim", function () {
setImmediate.should.be.a.Function;
setImmediate.should.be.a.Function();
});
it("should provide a global clearImmediate shim", function () {
clearImmediate.should.be.a.Function;
clearImmediate.should.be.a.Function();
});
it("should provide an assert shim", function () {
require("assert").should.be.a.Function;
require("assert").should.be.a.Function();
});
it("should provide a util shim", function () {
require("util").should.be.an.Object;
require("util").should.be.an.Object();
});
it("should provide a buffer shim", function () {
require("buffer").should.be.an.Object;
require("buffer").should.be.an.Object();
});
it("should provide a crypto shim", function () {
require("crypto").should.be.an.Object;
require("crypto").should.be.an.Object();
});
it("should provide a domain shim", function () {
require("domain").should.be.an.Object;
require("domain").should.be.an.Object();
});
it("should provide an events shim", function () {
require("events").should.be.a.Function;
require("events").should.be.a.Function();
});
it("should provide an http shim", function () {
require("http").should.be.an.Object;
require("http").should.be.an.Object();
});
it("should provide an https shim", function () {
require("https").should.be.an.Object;
require("https").should.be.an.Object();
});
it("should provide an os shim", function () {
require("os").should.be.an.Object;
require("os").should.be.an.Object();
});
it("should provide a path shim", function () {
require("path").should.be.an.Object;
require("path").should.be.an.Object();
});
it("should provide a punycode shim", function () {
require("punycode").should.be.an.Object;
require("punycode").should.be.an.Object();
});
it("should provide a stream shim", function () {
require("stream").should.be.a.Function;
require("stream").should.be.a.Function();
});
it("should provide a tty shim", function () {
require("tty").should.be.an.Object;
require("tty").should.be.an.Object();
});
it("should provide a url shim", function () {
require("url").should.be.an.Object;
require("url").should.be.an.Object();
});
it("should provide a util shim", function () {
require("util").should.be.an.Object;
require("util").should.be.an.Object();
});
it("should provide a vm shim", function () {
require("vm").should.be.an.Object;
require("vm").should.be.an.Object();
});
it("should provide a zlib shim", function () {
require("zlib").should.be.an.Object;
require("zlib").should.be.an.Object();
});
it("should provide a shim for a path in a build-in module", function () {