From 09a657860416d4849f54c3d8a988e0b857ed0fda Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Estev=C3=A3o=20Soares=20dos=20Santos?= Date: Sat, 11 Jul 2015 19:32:22 +0100 Subject: [PATCH] chore(grunt): make Grunt use a temporary build to avoid pollution of dist directory --- Gruntfile.js | 5 ++--- test/bootstrap.js | 1 + test/node/legacyExtensionSupport.js | 2 +- test/node/showdown.Converter.js | 2 +- test/node/showdown.Converter.makeHtml.js | 2 +- test/node/showdown.js | 2 +- test/node/testsuite.features.js | 4 ++-- test/node/testsuite.issues.js | 9 ++++----- test/node/testsuite.karlcow.js | 5 ++--- test/node/testsuite.standard.js | 5 ++--- 10 files changed, 17 insertions(+), 20 deletions(-) diff --git a/Gruntfile.js b/Gruntfile.js index dfe59932..a5d04c34 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -29,7 +29,7 @@ module.exports = function (grunt) { dest: 'dist/<%= pkg.name %>.js' }, test: { - src: '<%= concat.dist.dest %>', + src: '<%= concat.dist.src %>', dest: '.build/<%= pkg.name %>.js', options: { sourceMap: false @@ -159,9 +159,8 @@ module.exports = function (grunt) { grunt.task.run('simplemocha:node'); }); - grunt.registerTask('concatenate', ['concat:dist']); grunt.registerTask('lint', ['jshint', 'jscs']); - grunt.registerTask('test', ['lint', 'concat:test', 'simplemocha:node', 'clean']); + grunt.registerTask('test', ['clean', 'lint', 'concat:test', 'simplemocha:node', 'clean']); grunt.registerTask('build', ['test', 'concatenate', 'uglify']); grunt.registerTask('prep-release', ['build', 'changelog']); diff --git a/test/bootstrap.js b/test/bootstrap.js index 81d950a0..a969f710 100644 --- a/test/bootstrap.js +++ b/test/bootstrap.js @@ -92,6 +92,7 @@ getTestSuite: getTestSuite, assertion: assertion, normalize: normalize, + showdown: require('../.build/showdown.js') }; })(); diff --git a/test/node/legacyExtensionSupport.js b/test/node/legacyExtensionSupport.js index 354c4c75..268bc2b5 100644 --- a/test/node/legacyExtensionSupport.js +++ b/test/node/legacyExtensionSupport.js @@ -3,7 +3,7 @@ */ require('source-map-support').install(); var expect = require('chai').expect, - showdown = require('../../dist/showdown.js'); + showdown = require('../bootstrap').showdown; describe('showdown legacy extension support', function () { 'use strict'; diff --git a/test/node/showdown.Converter.js b/test/node/showdown.Converter.js index d796e3da..9ec4aa59 100644 --- a/test/node/showdown.Converter.js +++ b/test/node/showdown.Converter.js @@ -4,7 +4,7 @@ require('source-map-support').install(); require('chai').should(); require('sinon'); -var showdown = require('../../dist/showdown.js'); +var showdown = require('../bootstrap').showdown; describe('showdown.Converter', function () { 'use strict'; diff --git a/test/node/showdown.Converter.makeHtml.js b/test/node/showdown.Converter.makeHtml.js index 5cfabf9f..ce683a2b 100644 --- a/test/node/showdown.Converter.makeHtml.js +++ b/test/node/showdown.Converter.makeHtml.js @@ -8,7 +8,7 @@ describe('showdown.Converter', function () { require('source-map-support').install(); require('chai').should(); - var showdown = require('../../dist/showdown.js'); + var showdown = require('../bootstrap').showdown; describe('Converter.options extensions', function () { showdown.extensions.testext = function () { diff --git a/test/node/showdown.js b/test/node/showdown.js index e8a72a6c..bc65a308 100644 --- a/test/node/showdown.js +++ b/test/node/showdown.js @@ -1,7 +1,7 @@ require('source-map-support').install(); require('chai').should(); var expect = require('chai').expect, - showdown = require('../../dist/showdown.js'); + showdown = require('../bootstrap').showdown; describe('showdown.options', function () { 'use strict'; diff --git a/test/node/testsuite.features.js b/test/node/testsuite.features.js index b5496118..8de49235 100644 --- a/test/node/testsuite.features.js +++ b/test/node/testsuite.features.js @@ -1,8 +1,8 @@ /** * Created by Estevao on 08-06-2015. */ -var showdown = require('../../dist/showdown.js'), - bootstrap = require('../bootstrap.js'), +var bootstrap = require('../bootstrap.js'), + showdown = bootstrap.showdown, assertion = bootstrap.assertion, testsuite = bootstrap.getTestSuite('test/features/'), tableSuite = bootstrap.getTestSuite('test/features/tables/'); diff --git a/test/node/testsuite.issues.js b/test/node/testsuite.issues.js index 6b5d44a8..e2563db4 100644 --- a/test/node/testsuite.issues.js +++ b/test/node/testsuite.issues.js @@ -1,11 +1,10 @@ /** * Created by Estevao on 08-06-2015. */ -var showdown = require('../../dist/showdown.js'), - converter = new showdown.Converter(), - bootstrap = require('../bootstrap.js'), - assertion = bootstrap.assertion, - testsuite = bootstrap.getTestSuite('test/issues/'); +var bootstrap = require('../bootstrap.js'), + converter = new bootstrap.showdown.Converter(), + assertion = bootstrap.assertion, + testsuite = bootstrap.getTestSuite('test/issues/'); describe('makeHtml() issues testsuite', function () { 'use strict'; diff --git a/test/node/testsuite.karlcow.js b/test/node/testsuite.karlcow.js index 198cee76..2261dc24 100644 --- a/test/node/testsuite.karlcow.js +++ b/test/node/testsuite.karlcow.js @@ -1,6 +1,5 @@ -var showdown = require('../../dist/showdown.js'), - converter = new showdown.Converter({noHeaderId: true}), - bootstrap = require('../bootstrap.js'), +var bootstrap = require('../bootstrap.js'), + converter = new bootstrap.showdown.Converter({noHeaderId: true}), assertion = bootstrap.assertion, testsuite = bootstrap.getTestSuite('test/karlcow/'); diff --git a/test/node/testsuite.standard.js b/test/node/testsuite.standard.js index 1663ce13..62c21c89 100644 --- a/test/node/testsuite.standard.js +++ b/test/node/testsuite.standard.js @@ -1,6 +1,5 @@ -var showdown = require('../../dist/showdown.js'), - converter = new showdown.Converter(), - bootstrap = require('../bootstrap.js'), +var bootstrap = require('../bootstrap.js'), + converter = new bootstrap.showdown.Converter(), assertion = bootstrap.assertion, testsuite = bootstrap.getTestSuite('test/cases/');