Merge branch '4.x' into merge-4.x
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
module.exports = {
|
||||
extends: ['eslint:recommended', 'plugin:es5/no-es2015', 'prettier'],
|
||||
globals: {
|
||||
self: false
|
||||
},
|
||||
env: {
|
||||
node: true
|
||||
},
|
||||
rules: {
|
||||
'no-console': 'off',
|
||||
'no-var': 'off'
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,2 @@
|
||||
target
|
||||
package-lock.json
|
||||
@@ -0,0 +1,16 @@
|
||||
{
|
||||
"name": "multi-nodejs-test",
|
||||
"version": "1.0.0",
|
||||
"description": "Simple integration test with all relevant NodeJS-versions.",
|
||||
"keywords": [],
|
||||
"author": "Nils Knappmeier",
|
||||
"private": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"handlebars": "file:../../.."
|
||||
},
|
||||
"scripts": {
|
||||
"test": "node run-handlebars.js",
|
||||
"test-precompile": "handlebars precompile-test-template.txt.hbs"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
Author: {{author}}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
// This test should run successfully with node 0.10++ as long as Handlebars has been compiled before
|
||||
var assert = require('assert');
|
||||
var Handlebars = require('handlebars');
|
||||
|
||||
console.log('Testing built Handlebars with Node version ' + process.version);
|
||||
|
||||
var template = Handlebars.compile('Author: {{author}}');
|
||||
var output = template({ author: 'Yehuda' });
|
||||
assert.strictEqual(output, 'Author: Yehuda');
|
||||
|
||||
console.log('Success');
|
||||
Executable
+28
@@ -0,0 +1,28 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
cd "$( dirname "$( readlink -f "$0" )" )" || exit 1
|
||||
# shellcheck disable=SC1090
|
||||
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
|
||||
|
||||
# This script tests with precompiler and the built distribution with multiple NodeJS version.
|
||||
# This test is simple by design. It merely ensures, that calling Handlebars does not fail with old versions.
|
||||
# It does (almost) not test for correctness, because that is already done in the mocha-tests.
|
||||
# And it does not use any NodeJS based testing framework to make this part independent of the Node version.
|
||||
|
||||
unset npm_config_prefix
|
||||
|
||||
echo "Handlebars should be able to run in various versions of NodeJS"
|
||||
for node_version_to_test in 10 11 12 13 14 15 16 17; do
|
||||
|
||||
rm target node_modules package-lock.json -rf
|
||||
mkdir target
|
||||
|
||||
nvm install "$node_version_to_test"
|
||||
nvm exec "$node_version_to_test" npm install
|
||||
nvm exec "$node_version_to_test" npm run test
|
||||
nvm exec "$node_version_to_test" npm run test-precompile
|
||||
|
||||
echo Success
|
||||
done
|
||||
Reference in New Issue
Block a user