-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: add framework for various integration tests
- Loading branch information
Showing
17 changed files
with
94 additions
and
134 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
Add a new integration test by creating a new subfolder | ||
|
||
Add a file "test.sh" to that runs the test. "test.sh" should exit with a non-zero exit code | ||
and display an error message, if something goes wrong. | ||
|
||
* An integration test should reflect real-world setups that use handlebars. | ||
* It should compile a minimal template and compare the output to an expected output. | ||
* It should use "../.." as dependency for Handlebars so that the currently built library is used. | ||
|
||
Currently, integration tests are only running on Linux, especially in travis-ci. | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
module.exports = { | ||
"extends": "eslint:recommended", | ||
"globals": { | ||
"self": false | ||
}, | ||
"env": { | ||
"node": true | ||
}, | ||
"rules": { | ||
'no-console': 'off' | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
target |
1 change: 1 addition & 0 deletions
1
integration-testing/multi-nodejs-test/precompile-test-template.txt.hbs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Author: {{author}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
// This test should run successfully with node 0.10 as long as Handlebars has been compiled before | ||
var assert = require('assert'); | ||
var Handlebars = require('../../'); | ||
|
||
console.log('Testing build Handlebars with Node version ' + process.version); | ||
|
||
var output = Handlebars.compile('Author: {{author}}')({author: 'Yehuda'}); | ||
if (output !== 'Author: Yehuda') { | ||
throw new Error('Compiled output (' + compiledOutput + ') did not match expected output (' + expectedOutput + ')'); | ||
} | ||
|
||
assert.equal(output, 'Author: Yehuda') | ||
|
||
console.log('Success'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#!/bin/bash | ||
|
||
cd "$( dirname "$( readlink -f "$0" )" )" || exit 1 | ||
for i in */test.sh ; do | ||
( | ||
echo "----------------------------------------" | ||
echo "-- Running integration test: $i" | ||
echo "----------------------------------------" | ||
cd "$( dirname "$i" )" || exit 1 | ||
./test.sh || exit 1 | ||
) | ||
done |
Empty file.
17 changes: 17 additions & 0 deletions
17
integration-testing/webpack-handlebars-loader-test-npm/package-lock.json
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
15 changes: 15 additions & 0 deletions
15
integration-testing/webpack-handlebars-loader-test-npm/package.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"name": "webpack-handlebars-loader-test", | ||
"version": "1.0.0", | ||
"description": "", | ||
"main": "index.js", | ||
"scripts": { | ||
"test": "echo \"Error: no test specified\"" | ||
}, | ||
"keywords": [], | ||
"author": "", | ||
"license": "ISC", | ||
"dependencies": { | ||
"handlebars": "file:../.." | ||
} | ||
} |
3 changes: 3 additions & 0 deletions
3
integration-testing/webpack-handlebars-loader-test-npm/test.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
npm install | ||
npm test | ||
|
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.