Merge branch 'master' into develop

This commit is contained in:
Estevao Soares dos Santos 2017-03-05 05:09:52 +00:00
commit 97a29541a4
3 changed files with 100 additions and 19 deletions

53
.appveyor.yml Normal file
View File

@ -0,0 +1,53 @@
# branches to build
#branches:
# whitelist
#only:
# - master
# What combinations to test
environment:
matrix:
- nodejs_version: "0.10"
platform: x86
- nodejs_version: "0.12"
platform: x86
- nodejs_version: "4"
platform: x64
- nodejs_version: "4"
platform: x86
- nodejs_version: "6"
platform: x64
- nodejs_version: "7"
platform: x64
install:
# Use version based on tag
- ps: $env:package_version = (Get-Content -Raw -Path package.json | ConvertFrom-Json).version
- ps: Update-AppveyorBuild -Version "$env:package_version-$env:APPVEYOR_BUILD_NUMBER"
# install node
# Get the latest stable version of Node.js or io.js
- ps: Install-Product node $env:nodejs_version
- ps: >-
if ($env:nodejs_version -eq "0.12" -or $env:nodejs_version -eq "0.10") {
$env:PATH="$env:APPDATA\npm;$env:PATH"
}
# install grunt-cli globally
- npm install -g grunt-cli
# install modules
- npm install
test_script:
# Output useful info for debugging
- node --version && npm --version
- ps: >-
if ($env:nodejs_version -eq "0.12" -or $env:nodejs_version -eq "0.10") {
echo ----- Running tests in LEGACY mode -----
grunt test-old
} else {
echo ----- Running tests in NORMAL mode -----
grunt test
}
# Don't actually build.
build: off

View File

@ -169,15 +169,48 @@ module.exports = function (grunt) {
grunt.initConfig(config);
/**
* Load common tasks for legacy and normal tests
*/
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-conventional-changelog');
grunt.loadNpmTasks('grunt-conventional-github-releaser');
grunt.loadNpmTasks('grunt-endline');
grunt.loadNpmTasks('grunt-simple-mocha');
grunt.loadNpmTasks('grunt-endline');
grunt.loadNpmTasks('grunt-contrib-jshint');
/**
* Generate Changelog
*/
grunt.registerTask('generate-changelog', function () {
'use strict';
grunt.loadNpmTasks('grunt-conventional-changelog');
grunt.loadNpmTasks('grunt-conventional-github-releaser');
grunt.task.run('conventionalChangelog');
});
/**
* Lint tasks
*/
grunt.registerTask('lint', function () {
'use strict';
grunt.loadNpmTasks('grunt-eslint');
grunt.task.run('jshint', 'eslint');
});
/**
* Performance task
*/
grunt.registerTask('performancejs', function () {
'use strict';
var perf = require('./test/node/performance.js');
perf.runTests();
perf.generateLogs();
});
/**
* Run a single test
*/
grunt.registerTask('single-test', function (grep) {
'use strict';
grunt.config.merge({
@ -193,24 +226,19 @@ module.exports = function (grunt) {
grunt.task.run(['lint', 'concat:test', 'simplemocha:single', 'clean']);
});
grunt.registerTask('performancejs', function () {
'use strict';
var perf = require('./test/node/performance.js');
perf.runTests();
perf.generateLogs();
});
grunt.registerTask('lint', function () {
'use strict';
grunt.loadNpmTasks('grunt-eslint');
grunt.task.run('jshint', 'eslint');
});
grunt.registerTask('test', ['clean', 'lint', 'concat:test', 'simplemocha:node', 'clean']);
/**
* Test in Legacy Node
*/
grunt.registerTask('test-old', ['concat:test', 'simplemocha:node', 'clean']);
/**
* Tasks for new node versions
*/
grunt.registerTask('test', ['clean', 'lint', 'concat:test', 'simplemocha:node', 'clean']);
grunt.registerTask('performance', ['concat:test', 'performancejs', 'clean']);
grunt.registerTask('build', ['test', 'concat:dist', 'uglify', 'endline']);
grunt.registerTask('prep-release', ['build', 'conventionalChangelog']);
grunt.registerTask('prep-release', ['build', 'generate-changelog']);
// Default task(s).
grunt.registerTask('default', ['test']);

View File

@ -12,7 +12,7 @@ describe('showdown.Converter', function () {
describe('Converter.options extensions', function () {
var runCount;
showdown.extensions.testext = function () {
showdown.extension('testext', function () {
return [{
type: 'output',
filter: function (text) {
@ -20,7 +20,7 @@ describe('showdown.Converter', function () {
return text;
}
}];
};
});
var converter = new showdown.Converter({extensions: ['testext']});