Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
18 changed files
with
103 additions
and
38 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,3 +12,4 @@ npm-debug.log | |
sauce_connect.log* | ||
.idea | ||
yarn-error.log | ||
/handlebars-release.tgz |
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
Empty file.
17 changes: 0 additions & 17 deletions
17
integration-testing/webpack-handlebars-loader-test-npm/package-lock.json
This file was deleted.
Oops, something went wrong.
15 changes: 0 additions & 15 deletions
15
integration-testing/webpack-handlebars-loader-test-npm/package.json
This file was deleted.
Oops, something went wrong.
5 changes: 0 additions & 5 deletions
5
integration-testing/webpack-handlebars-loader-test-npm/test.sh
This file was deleted.
Oops, something went wrong.
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 @@ | ||
node_modules | ||
dist | ||
package-lock.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,21 @@ | ||
{ | ||
"name": "webpack-test", | ||
"version": "1.0.0", | ||
"main": "index.js", | ||
"scripts": { | ||
"build": "webpack --config webpack.config.js", | ||
"test": "node dist/main.js" | ||
}, | ||
"private": true, | ||
"keywords": [], | ||
"author": "", | ||
"license": "ISC", | ||
"dependencies": {}, | ||
"devDependencies": { | ||
"handlebars": "file:../..", | ||
"handlebars-loader": "^1.7.1", | ||
"webpack": "^4.39.3", | ||
"webpack-cli": "^3.3.7" | ||
}, | ||
"description": "" | ||
} |
6 changes: 6 additions & 0 deletions
6
integration-testing/webpack-test/src/handlebars-default-import-pre-4.2-test.js
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,6 @@ | ||
import Handlebars from 'handlebars/dist/handlebars'; | ||
|
||
import {assertEquals} from './lib/assert'; | ||
|
||
const template = Handlebars.compile('Author: {{author}}'); | ||
assertEquals(template({author: 'Yehuda'}), 'Author: Yehuda'); |
6 changes: 6 additions & 0 deletions
6
integration-testing/webpack-test/src/handlebars-default-import-test.js
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,6 @@ | ||
import Handlebars from 'handlebars'; | ||
import {assertEquals} from './lib/assert'; | ||
|
||
|
||
const template = Handlebars.compile('Author: {{author}}'); | ||
assertEquals(template({author: 'Yehuda'}), 'Author: Yehuda'); |
8 changes: 8 additions & 0 deletions
8
integration-testing/webpack-test/src/handlebars-loader-test.js
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,8 @@ | ||
import {assertEquals} from './lib/assert'; | ||
|
||
import testTemplate from './test-template.handlebars'; | ||
assertEquals(testTemplate({author: 'Yehuda'}).trim(), 'Author: Yehuda'); | ||
|
||
|
||
const testTemplateRequire = require('./test-template.handlebars'); | ||
assertEquals(testTemplateRequire({author: 'Yehuda'}).trim(), 'Author: Yehuda'); |
6 changes: 6 additions & 0 deletions
6
integration-testing/webpack-test/src/handlebars-wildcard-import-pre-4.2-test.js
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,6 @@ | ||
import * as Handlebars from 'handlebars/dist/handlebars'; | ||
|
||
import {assertEquals} from './lib/assert'; | ||
|
||
const template = Handlebars.compile('Author: {{author}}'); | ||
assertEquals(template({author: 'Yehuda'}), 'Author: Yehuda'); |
5 changes: 5 additions & 0 deletions
5
integration-testing/webpack-test/src/handlebars-wildcard-import-test.js
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,5 @@ | ||
import * as Handlebars from 'handlebars'; | ||
import {assertEquals} from './lib/assert'; | ||
|
||
const template = Handlebars.compile('Author: {{author}}'); | ||
assertEquals(template({author: 'Yehuda'}), 'Author: Yehuda'); |
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,5 @@ | ||
export function assertEquals(actual, expected) { | ||
if (actual !== expected) { | ||
throw new Error(`Expected "${actual}" to equal "${expected}"`); | ||
} | ||
} |
2 changes: 2 additions & 0 deletions
2
integration-testing/webpack-test/src/test-template.handlebars
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,2 @@ | ||
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,16 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
# Cleanup: package-lock and "npm ci" is not working with local dependencies | ||
rm dist package-lock.json -rf | ||
npm install | ||
npm run build | ||
|
||
for i in dist/*-test.js ; do | ||
echo "----------------------" | ||
echo "-- Running $i" | ||
echo "----------------------" | ||
node "$i" | ||
echo "Success" | ||
done |
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,22 @@ | ||
const fs = require('fs'); | ||
|
||
const testFiles = fs.readdirSync('src'); | ||
const entryPoints = {}; | ||
testFiles | ||
.filter(file => file.match(/-test.js$/)) | ||
.forEach(file => { | ||
entryPoints[file] = `./src/${file}`; | ||
}); | ||
|
||
module.exports = { | ||
entry: entryPoints, | ||
output: { | ||
filename: '[name]', | ||
path: __dirname + '/dist' | ||
}, | ||
module: { | ||
rules: [ | ||
{test: /\.handlebars$/, loader: 'handlebars-loader'} | ||
] | ||
} | ||
}; |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.