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"); });
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"); });