From 70768340921f6aecd73d38b98c8a5b7b937014d3 Mon Sep 17 00:00:00 2001 From: Nico Rehwaldt Date: Wed, 6 Mar 2024 15:09:09 +0100 Subject: [PATCH] test: inline `distro` tests Simplifies our build pipeline. --- package.json | 5 ++--- test/distro/moddle-xml.cjs | 23 ----------------------- test/integration/distro.cjs | 27 +++++++++++++++++++++++++++ 3 files changed, 29 insertions(+), 26 deletions(-) delete mode 100644 test/distro/moddle-xml.cjs create mode 100644 test/integration/distro.cjs diff --git a/package.json b/package.json index ee94fdf..fd2a971 100644 --- a/package.json +++ b/package.json @@ -3,12 +3,11 @@ "version": "11.0.0", "description": "XML import/export for documents described with moddle", "scripts": { - "all": "run-s lint test test:distro", + "all": "run-s lint test", "build": "rollup -c", "dev": "npm test -- --watch", "lint": "eslint . --ext cjs,js", - "test": "mocha --reporter=spec --recursive test/spec", - "test:distro": "mocha --reporter=spec --recursive test/distro", + "test": "mocha --reporter=spec --recursive test", "pretest": "run-s build", "prepare": "run-s build" }, diff --git a/test/distro/moddle-xml.cjs b/test/distro/moddle-xml.cjs deleted file mode 100644 index d1b3b17..0000000 --- a/test/distro/moddle-xml.cjs +++ /dev/null @@ -1,23 +0,0 @@ -const { - expect -} = require('chai'); - -const pkg = require('../../package.json'); - -const pkgExports = pkg.exports['.']; - - -describe('moddle-xml', function() { - - it('should expose CJS bundle', function() { - - const { - Reader, - Writer - } = require('../../' + pkgExports['require']); - - expect(Reader).to.exist; - expect(Writer).to.exist; - }); - -}); diff --git a/test/integration/distro.cjs b/test/integration/distro.cjs new file mode 100644 index 0000000..4b3181b --- /dev/null +++ b/test/integration/distro.cjs @@ -0,0 +1,27 @@ +const { + expect +} = require('chai'); + +const pkg = require('../../package.json'); + +const pkgExports = pkg.exports['.']; + + +describe('integration', function() { + + describe('distro', function() { + + it('should expose CJS bundle', function() { + + const { + Reader, + Writer + } = require('../../' + pkgExports['require']); + + expect(Reader).to.exist; + expect(Writer).to.exist; + }); + + }); + +});