Skip to content

Commit

Permalink
test(appveyor): add appveyor testing
Browse files Browse the repository at this point in the history
Add testing on windows environment
  • Loading branch information
tivie authored Mar 5, 2017
1 parent cee6be6 commit c6ac36d
Show file tree
Hide file tree
Showing 4 changed files with 99 additions and 42 deletions.
53 changes: 53 additions & 0 deletions .appveyor.yml
Original file line number Diff line number Diff line change
@@ -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
60 changes: 44 additions & 16 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand All @@ -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');
});
/**
* 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('test-old', ['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']);
Expand Down
24 changes: 0 additions & 24 deletions test/node/legacyExtensionSupport.js

This file was deleted.

4 changes: 2 additions & 2 deletions test/node/showdown.Converter.makeHtml.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@ 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) {
runCount = runCount + 1;
return text;
}
}];
};
});

var converter = new showdown.Converter({extensions: ['testext']});

Expand Down

0 comments on commit c6ac36d

Please sign in to comment.