From 64c496051fb0dcb850d64443a79580765355b371 Mon Sep 17 00:00:00 2001 From: Mickael Jeanroy Date: Sun, 5 Apr 2020 18:17:40 +0200 Subject: [PATCH] chore: usre @babel/register --- gulpfile.js | 8 +++++++- package.json | 1 + scripts/test/index.js | 4 +--- test/base.spec.js | 4 ++-- test/dependency.spec.js | 2 +- test/format-path.spec.js | 2 +- test/generate-block-comment.spec.js | 2 +- test/index-rollup-legacy.spec.js | 2 +- test/index-rollup-stable.spec.js | 2 +- test/integration/it.spec.js | 2 +- test/license-plugin-option.spec.js | 2 +- test/license-plugin.spec.js | 2 +- test/license-validator.spec.js | 2 +- test/person.spec.js | 2 +- test/schema-validator.spec.js | 4 ++-- test/schema-validators.spec.js | 2 +- 16 files changed, 24 insertions(+), 19 deletions(-) diff --git a/gulpfile.js b/gulpfile.js index 083cc1aa..916c9f1b 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -22,6 +22,12 @@ * SOFTWARE. */ +require('@babel/register')({ + ignore: [ + /node_modules/, + ], +}); + const gulp = require('gulp'); const clean = require('./scripts/clean'); const lint = require('./scripts/lint'); @@ -39,7 +45,7 @@ module.exports = { 'lint': lint, 'build': gulp.series(prebuild, build), 'test': gulp.series(pretest, test.test), - 'tdd': gulp.series(clean, build, test.tdd), + 'tdd': gulp.series(pretest, test.tdd), 'changelog': changelog, 'release:patch': gulp.series(prerelease, release.patch), 'release:minor': gulp.series(prerelease, release.minor), diff --git a/package.json b/package.json index f5f7639a..168e869b 100644 --- a/package.json +++ b/package.json @@ -45,6 +45,7 @@ "devDependencies": { "@babel/core": "7.9.0", "@babel/preset-env": "7.9.0", + "@babel/register": "7.9.0", "eslint": "6.8.0", "eslint-config-google": "0.14.0", "fancy-log": "1.3.3", diff --git a/scripts/test/index.js b/scripts/test/index.js index 59be6bb9..17686fea 100644 --- a/scripts/test/index.js +++ b/scripts/test/index.js @@ -25,7 +25,6 @@ const path = require('path'); const gulp = require('gulp'); const jasmine = require('gulp-jasmine'); -const build = require('../build'); const config = require('../config'); /** @@ -49,8 +48,7 @@ function test() { * @return {void} */ function tdd(done) { - gulp.watch(path.join(config.dist, '**', '*.js'), test); - gulp.watch(path.join(config.src, '**', '*.js'), build); + gulp.watch(path.join(config.src, '**', '*.js'), test); gulp.watch(path.join(config.test, '**', '*.js'), test); done(); diff --git a/test/base.spec.js b/test/base.spec.js index 443fe705..503a61e9 100644 --- a/test/base.spec.js +++ b/test/base.spec.js @@ -23,8 +23,8 @@ */ const _ = require('lodash'); -const Dependency = require('../dist/dependency.js'); -const Person = require('../dist/person.js'); +const Dependency = require('../src/dependency.js'); +const Person = require('../src/person.js'); beforeEach(() => { jasmine.addCustomEqualityTester((first, second) => { diff --git a/test/dependency.spec.js b/test/dependency.spec.js index ab1ee848..944ef698 100644 --- a/test/dependency.spec.js +++ b/test/dependency.spec.js @@ -23,7 +23,7 @@ */ const join = require('./utils/join.js'); -const Dependency = require('../dist/dependency.js'); +const Dependency = require('../src/dependency.js'); describe('Dependency', () => { it('should should extract package fields', () => { diff --git a/test/format-path.spec.js b/test/format-path.spec.js index 9bab31c8..879099a6 100644 --- a/test/format-path.spec.js +++ b/test/format-path.spec.js @@ -24,7 +24,7 @@ 'use strict'; -const formatPath = require('../dist/format-path.js'); +const formatPath = require('../src/format-path.js'); describe('formatPath', () => { it('should format path of object', () => { diff --git a/test/generate-block-comment.spec.js b/test/generate-block-comment.spec.js index 89b8a20b..42858ed1 100644 --- a/test/generate-block-comment.spec.js +++ b/test/generate-block-comment.spec.js @@ -23,7 +23,7 @@ */ const join = require('./utils/join.js'); -const generateBlockComment = require('../dist/generate-block-comment.js'); +const generateBlockComment = require('../src/generate-block-comment.js'); describe('generateBlockComment', () => { it('should generate block comment from given text', () => { diff --git a/test/index-rollup-legacy.spec.js b/test/index-rollup-legacy.spec.js index 918196be..0f816f4d 100644 --- a/test/index-rollup-legacy.spec.js +++ b/test/index-rollup-legacy.spec.js @@ -26,7 +26,7 @@ const path = require('path'); const fs = require('fs'); const tmp = require('tmp'); const join = require('./utils/join.js'); -const plugin = require('../dist/index-rollup-legacy.js'); +const plugin = require('../src/index-rollup-legacy.js'); describe('rollup-plugin-license [rollup legacy]', () => { let tmpDir; diff --git a/test/index-rollup-stable.spec.js b/test/index-rollup-stable.spec.js index a09c3fe8..1cfbe919 100644 --- a/test/index-rollup-stable.spec.js +++ b/test/index-rollup-stable.spec.js @@ -28,7 +28,7 @@ const path = require('path'); const fs = require('fs'); const tmp = require('tmp'); const join = require('./utils/join.js'); -const plugin = require('../dist/index-rollup-stable.js'); +const plugin = require('../src/index-rollup-stable.js'); describe('rollup-plugin-license [rollup stable]', () => { let tmpDir; diff --git a/test/integration/it.spec.js b/test/integration/it.spec.js index 44133b60..b9ce28b6 100644 --- a/test/integration/it.spec.js +++ b/test/integration/it.spec.js @@ -32,7 +32,7 @@ const rollup = require('rollup'); const nodeResolve = require('rollup-plugin-node-resolve'); const commonjs = require('rollup-plugin-commonjs'); const join = require('../utils/join.js'); -const licensePlugin = require('../../dist/index.js'); +const licensePlugin = require('../../src/index.js'); describe('Dependency', () => { let warn; diff --git a/test/license-plugin-option.spec.js b/test/license-plugin-option.spec.js index ac789ca1..0e8b4211 100644 --- a/test/license-plugin-option.spec.js +++ b/test/license-plugin-option.spec.js @@ -24,7 +24,7 @@ 'use strict'; -const licensePluginOptions = require('../dist/license-plugin-option.js'); +const licensePluginOptions = require('../src/license-plugin-option.js'); describe('licensePluginOptions', () => { it('should validate option', () => { diff --git a/test/license-plugin.spec.js b/test/license-plugin.spec.js index a909bed1..ace2b47b 100644 --- a/test/license-plugin.spec.js +++ b/test/license-plugin.spec.js @@ -29,7 +29,7 @@ const path = require('path'); const tmp = require('tmp'); const moment = require('moment'); const join = require('./utils/join.js'); -const licensePlugin = require('../dist/license-plugin.js'); +const licensePlugin = require('../src/license-plugin.js'); describe('LicensePlugin', () => { let tmpDir; diff --git a/test/license-validator.spec.js b/test/license-validator.spec.js index c0936c90..efb24356 100644 --- a/test/license-validator.spec.js +++ b/test/license-validator.spec.js @@ -24,7 +24,7 @@ 'use strict'; -const licenseValidator = require('../dist/license-validator.js'); +const licenseValidator = require('../src/license-validator.js'); describe('licenseValidator', () => { it('should check for unlicensed dependency', () => { diff --git a/test/person.spec.js b/test/person.spec.js index 0eac7507..604c82c2 100644 --- a/test/person.spec.js +++ b/test/person.spec.js @@ -22,7 +22,7 @@ * SOFTWARE. */ -const Person = require('../dist/person.js'); +const Person = require('../src/person.js'); describe('Person', () => { it('should parse author name', () => { diff --git a/test/schema-validator.spec.js b/test/schema-validator.spec.js index 10a66c44..d6655d46 100644 --- a/test/schema-validator.spec.js +++ b/test/schema-validator.spec.js @@ -24,8 +24,8 @@ 'use strict'; -const validateSchema = require('../dist/schema-validator.js'); -const validators = require('../dist/schema-validators.js'); +const validateSchema = require('../src/schema-validator.js'); +const validators = require('../src/schema-validators.js'); describe('validateSchema', () => { it('should validate simple object', () => { diff --git a/test/schema-validators.spec.js b/test/schema-validators.spec.js index 81770b4a..3001179d 100644 --- a/test/schema-validators.spec.js +++ b/test/schema-validators.spec.js @@ -22,7 +22,7 @@ * SOFTWARE. */ -const validators = require('../dist/schema-validators.js'); +const validators = require('../src/schema-validators.js'); describe('schema validators', () => { it('should validate string', () => {