mirror of https://github.com/webpack/webpack.git
few more test migration fixes
This commit is contained in:
parent
5ed75dd121
commit
3d23bbcfe4
|
@ -1,6 +1,6 @@
|
||||||
it("should support an empty context", function() {
|
it("should support an empty context", function() {
|
||||||
var c = require.context(".", true, /^nothing$/);
|
var c = require.context(".", true, /^nothing$/);
|
||||||
expect(typeof c.id).to.be.oneOf(["number", "string"]);
|
expect(typeof c.id === "number" || typeof c.id === "string").toBeTruthy();
|
||||||
expect(function() {
|
expect(function() {
|
||||||
c.resolve("");
|
c.resolve("");
|
||||||
}).toThrowError();
|
}).toThrowError();
|
||||||
|
|
|
@ -3,11 +3,11 @@ it("should evaluate require.resolve as truthy value", function() {
|
||||||
if(require.resolve)
|
if(require.resolve)
|
||||||
id = require.resolve("./module.js");
|
id = require.resolve("./module.js");
|
||||||
|
|
||||||
expect(typeof id).to.be.oneOf("number", "string");
|
expect(typeof id === "number" || typeof id === "string").toBeTruthy();
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should evaluate require.resolve in ?: expression", function() {
|
it("should evaluate require.resolve in ?: expression", function() {
|
||||||
var id = require.resolve ? require.resolve("./module.js") : null;
|
var id = require.resolve ? require.resolve("./module.js") : null;
|
||||||
|
|
||||||
expect(typeof id).to.be.oneOf("number", "string");
|
expect(typeof id === "number" || typeof id === "string").toBeTruthy();
|
||||||
});
|
});
|
||||||
|
|
|
@ -16,6 +16,6 @@ it("should make different modules for query", function() {
|
||||||
expect(require("return-module")).toBe("module is returned");
|
expect(require("return-module")).toBe("module is returned");
|
||||||
|
|
||||||
const overrideExports = require("override-exports");
|
const overrideExports = require("override-exports");
|
||||||
expect(overrideExports).to.be.a.Object();
|
expect(overrideExports).toBeOfType("object");
|
||||||
expect(Object.keys(overrideExports).length).to.be.exactly(0);
|
expect(Object.keys(overrideExports)).toHaveLength(0);
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue