Skip to content

Commit

Permalink
test: inline distro test
Browse files Browse the repository at this point in the history
Simplifies our build pipeline.
  • Loading branch information
nikku committed Mar 6, 2024
1 parent 61073fc commit 7dd6a47
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 33 deletions.
7 changes: 3 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,13 @@
"version": "7.0.0",
"description": "A library for importing meta-model based file formats into JS",
"scripts": {
"all": "run-s lint test test:build",
"all": "run-s lint test",
"lint": "eslint .",
"pretest": "run-s build",
"dev": "npm test -- --watch",
"test": "mocha --reporter=spec --recursive test/spec",
"test": "mocha --reporter=spec --recursive test",
"build": "rollup -c",
"prepare": "npm run build",
"test:build": "mocha --reporter=spec --recursive test/distro"
"prepare": "run-s build"
},
"type": "module",
"exports": {
Expand Down
29 changes: 0 additions & 29 deletions test/distro/moddle.cjs

This file was deleted.

33 changes: 33 additions & 0 deletions test/integration/distro.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
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 {
Moddle,
isSimpleType,
isBuiltInType,
parseNameNS,
coerceType
} = require('../../' + pkgExports.require);

expect(new Moddle()).to.exist;

expect(isSimpleType).to.exist;
expect(isBuiltInType).to.exist;
expect(parseNameNS).to.exist;
expect(coerceType).to.exist;
});

});

});

0 comments on commit 7dd6a47

Please sign in to comment.