diff --git a/package.json b/package.json index 9f22c113..aeacf6ff 100644 --- a/package.json +++ b/package.json @@ -78,7 +78,7 @@ "publish:minor": "npm version minor -m 'Release minor %s'", "publish:major": "npm version major -m 'Release major %s'", "lint": "standard", - "test": "node test/core-icons.test.mjs", + "test": "node test/core-icons.test.mjs && node test/core-icons.test.js", "preversion": "testpack", "postversion": "npm run build && git push && git push --tags && npm publish", "start": "npm run build:watch & http-server ./static -o -p 10001 -c-1", diff --git a/test/core-icons.test.js b/test/core-icons.test.js new file mode 100644 index 00000000..61c00f8b --- /dev/null +++ b/test/core-icons.test.js @@ -0,0 +1,13 @@ +// Test package exports using testpack-cli +const icons = require('@nrk/core-icons') +const expressive = require('@nrk/core-icons/expressive') +const logos = require('@nrk/core-icons/logo') +const previews = require('@nrk/core-icons/preview') + +console.info(` +Package contains the following for commonJS:\n + - ${Object.keys(icons).length} icons\n + - ${Object.keys(expressive).length} expressive icons\n + - ${Object.keys(logos).length} logos\n + - ${Object.keys(previews).length} previews\n +`) diff --git a/test/core-icons.test.mjs b/test/core-icons.test.mjs index ef6671c5..cd9a2b75 100644 --- a/test/core-icons.test.mjs +++ b/test/core-icons.test.mjs @@ -5,9 +5,9 @@ import * as logos from '@nrk/core-icons/logo' import * as previews from '@nrk/core-icons/preview' console.info(` -Package contains the following:\n +Package contains the following for ESM:\n - ${Object.keys(icons).length} icons\n - ${Object.keys(expressive).length} expressive icons\n - ${Object.keys(logos).length} logos\n - - ${Object.keys(previews).length} logos\n + - ${Object.keys(previews).length} previews\n `)