Skip to content

Commit

Permalink
chore(grunt): make Grunt use a temporary build to avoid pollution of …
Browse files Browse the repository at this point in the history
…dist directory
  • Loading branch information
tivie committed Jul 11, 2015
1 parent f9cf0e6 commit 09a6578
Show file tree
Hide file tree
Showing 10 changed files with 17 additions and 20 deletions.
5 changes: 2 additions & 3 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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']);

Expand Down
1 change: 1 addition & 0 deletions test/bootstrap.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@
getTestSuite: getTestSuite,
assertion: assertion,
normalize: normalize,
showdown: require('../.build/showdown.js')
};
})();

2 changes: 1 addition & 1 deletion test/node/legacyExtensionSupport.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
2 changes: 1 addition & 1 deletion test/node/showdown.Converter.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
2 changes: 1 addition & 1 deletion test/node/showdown.Converter.makeHtml.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 () {
Expand Down
2 changes: 1 addition & 1 deletion test/node/showdown.js
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
4 changes: 2 additions & 2 deletions test/node/testsuite.features.js
Original file line number Diff line number Diff line change
@@ -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/');
Expand Down
9 changes: 4 additions & 5 deletions test/node/testsuite.issues.js
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
5 changes: 2 additions & 3 deletions test/node/testsuite.karlcow.js
Original file line number Diff line number Diff line change
@@ -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/');

Expand Down
5 changes: 2 additions & 3 deletions test/node/testsuite.standard.js
Original file line number Diff line number Diff line change
@@ -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/');

Expand Down

0 comments on commit 09a6578

Please sign in to comment.