From f2ef9d59021ffd083357ce97050acb005adc05f4 Mon Sep 17 00:00:00 2001 From: Jake Champion Date: Fri, 5 Jul 2019 11:45:38 +0100 Subject: [PATCH] Add tests for missing features of the polyfill --- test/es6-shim.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/test/es6-shim.js b/test/es6-shim.js index b0de9e5..b44e052 100644 --- a/test/es6-shim.js +++ b/test/es6-shim.js @@ -15,6 +15,19 @@ describe("es6-shim", function () { myit("length property of the normalize method is 0.", function () { assert("foo".normalize.length, 0, "length property of the normalize method is 0."); + assert(String.prototype.normalize.length, 0, "length property of the normalize method is 0."); + }); + + it("throws TypeError if `this` is null", function () { + assert.throws(function () { + String.prototype.normalize.call(null); + }, TypeError); + }); + + it("throws TypeError if `this` is undefined", function () { + assert.throws(function () { + String.prototype.normalize.call(undefined); + }, TypeError); }); myit("If f is not one of \"NFC\", \"NFD\", \"NFKC\", or \"NFKD\", then throw a RangeError Exception.", function () {