From 5d6bd756196c4e27129d09afe849c721226d8e7e Mon Sep 17 00:00:00 2001 From: David Majda Date: Fri, 16 Dec 2016 13:43:22 +0100 Subject: [PATCH] Tests: Use "to.be.{a,an}" instead of "expect(typeof ...)" --- test/api/pegjs-api.spec.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/api/pegjs-api.spec.js b/test/api/pegjs-api.spec.js index 2a4a80c..75a4cbb 100644 --- a/test/api/pegjs-api.spec.js +++ b/test/api/pegjs-api.spec.js @@ -11,7 +11,7 @@ describe("PEG.js API", function() { it("generates a parser", function() { let parser = peg.generate("start = 'a'"); - expect(typeof parser).to.equal("object"); + expect(parser).to.be.an("object"); expect(parser.parse("a")).to.equal("a"); }); @@ -163,7 +163,7 @@ describe("PEG.js API", function() { it("returns generated parser object", function() { let parser = peg.generate(grammar); - expect(typeof parser).to.equal("object"); + expect(parser).to.be.an("object"); expect(parser.parse("a")).to.equal("a"); }); }); @@ -172,7 +172,7 @@ describe("PEG.js API", function() { it("returns generated parser object", function() { let parser = peg.generate(grammar, { output: "parser" }); - expect(typeof parser).to.equal("object"); + expect(parser).to.be.an("object"); expect(parser.parse("a")).to.equal("a"); }); }); @@ -181,7 +181,7 @@ describe("PEG.js API", function() { it("returns generated parser source code", function() { let source = peg.generate(grammar, { output: "source" }); - expect(typeof source).to.equal("string"); + expect(source).to.be.a("string"); expect(eval(source).parse("a")).to.equal("a"); }); });