示例#1
0
文件: index.js 项目: stlclass/webpack
it("should be able to import commonjs", function() {
	function x() { throw new Error("should not be executed"); }
	// next line doesn't end with semicolon
	x
	Thing.should.have.type("function");
	Thing().should.be.eql("thing");
	Other.should.be.eql("other");

	Thing2.should.have.type("function");
	new Thing2().value.should.be.eql("thing");
	Other2.should.be.eql("other");
});
示例#2
0
文件: index.js 项目: ICELI/webpack
it("should be able to import commonjs", function() {
	function x() { throw new Error("should not be executed"); }
	// next line doesn't end with semicolon
	x
	expect(Thing).toBeTypeOf("function");
	x
	expect(Thing()).toBe("thing");
	x
	expect(Other).toBe("other");

	expect(Thing2).toBeTypeOf("function");
	expect(new Thing2().value).toBe("thing");
	expect(Other2).toBe("other");
	expect(Thing3()).toBe("thing");
});