From 288e306d12b656fd4b372fc0c7843c9b9f55408f Mon Sep 17 00:00:00 2001 From: Siddharth VP Date: Thu, 14 Jan 2021 18:01:27 +0530 Subject: [PATCH] Mock mw.libs.pluralruleparser with npm package --- package-lock.json | 6 ++++++ package.json | 1 + test/banana.test.js | 8 ++++++++ 3 files changed, 15 insertions(+) diff --git a/package-lock.json b/package-lock.json index a022aea..88e22a8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2425,6 +2425,12 @@ } } }, + "cldrpluralruleparser": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/cldrpluralruleparser/-/cldrpluralruleparser-1.3.2.tgz", + "integrity": "sha512-z+/RRFz5oMy7nglARs8D+uQhqOIwobNHJwdGBp0nDFpQXVUbVEf80VDQ8xW0ifiEldyWdpylJxLNMcQCAq2esg==", + "dev": true + }, "cli-cursor": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-2.1.0.tgz", diff --git a/package.json b/package.json index 8abb778..b210e13 100644 --- a/package.json +++ b/package.json @@ -24,6 +24,7 @@ }, "license": "MIT", "devDependencies": { + "cldrpluralruleparser": "^1.3.2", "eslint": "^5.16.0", "eslint-config-standard": "^12.0.0", "eslint-plugin-import": "^2.20.2", diff --git a/test/banana.test.js b/test/banana.test.js index 7b0690c..fe594a8 100644 --- a/test/banana.test.js +++ b/test/banana.test.js @@ -4,6 +4,14 @@ import Banana from '../src/' import assert from 'assert' import fs from 'fs' +// Mock mw.libs.pluralruleparser using the equivalent npm package +import cldrpluralruleparser from 'cldrpluralruleparser' +global.mw = { + libs: { + pluralRuleParser: cldrpluralruleparser + } +} + const grammarTests = { bs: [{ word: 'word',