diff --git a/aio/package.json b/aio/package.json index 00fb7462f0..31425140c9 100644 --- a/aio/package.json +++ b/aio/package.json @@ -29,7 +29,7 @@ "docs": "dgeni ./tools/transforms/angular.io-package", "docs-watch": "node tools/transforms/authors-package/watchr.js", "docs-lint": "eslint --ignore-path=\"tools/transforms/.eslintignore\" tools/transforms", - "docs-test": "jasmine tools/transforms/**/*.spec.js", + "docs-test": "node tools/transforms/test.js", "~~update-webdriver": "webdriver-manager update --standalone false --gecko false", "boilerplate:add": "node ./tools/examples/add-example-boilerplate add", "boilerplate:remove": "node ./tools/examples/add-example-boilerplate remove", diff --git a/aio/tools/transforms/test.js b/aio/tools/transforms/test.js new file mode 100644 index 0000000000..48967ddd45 --- /dev/null +++ b/aio/tools/transforms/test.js @@ -0,0 +1,17 @@ +/* + * Use this script to run the tests for the doc generation + * We cannot use the Jasmine CLI directly because it doesn't seem to + * understand the glob and only runs one spec file. + * + * Equally we cannot use a jasmine.json config file because it doesn't + * allow us to set the projectBaseDir, which means that you have to run + * jasmine CLI from this directory. + * + * Using a file like this gives us full control and keeps the package.json + * file clean and simple. + */ + +const Jasmine = require('jasmine'); +const jasmine = new Jasmine({ projectBaseDir: __dirname }); +jasmine.loadConfig({ spec_files: ['**/*.spec.js'] }); +jasmine.execute();