Skip to content

Commit

Permalink
Merge pull request #269 from Robert-Frampton/iso_test
Browse files Browse the repository at this point in the history
Adds tests for server side rendering of Soy and JSX components
  • Loading branch information
jbalsas authored Oct 11, 2017
2 parents 12fe8a7 + 391f030 commit cfe20c6
Show file tree
Hide file tree
Showing 36 changed files with 6,204 additions and 16,745 deletions.
3 changes: 3 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"presets": ["env"]
}
4 changes: 3 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,6 @@ jdk:

language: java

script: gulp test:saucelabs
script:
- gulp test:saucelabs
- npm run test:isomorphic
8 changes: 7 additions & 1 deletion gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,12 @@ gulp.task('soy', function() {
.pipe(gulp.dest('packages/metal-soy/test'));
});

gulp.task('soy:isomorphic', function() {
return gulp.src('packages/metal-isomorphic/test/**/*.soy')
.pipe(compileSoy())
.pipe(gulp.dest('packages/metal-isomorphic/test'));
});

gulp.task('build:cjs', ['soy'], function() {
return compileToLib('packages/metal*/src/**/*.js');
});
Expand Down Expand Up @@ -148,7 +154,7 @@ function calcDestDir(file) {
function compileToLib(src) {
return gulp.src(src)
.pipe(babel({
presets: ['es2015']
presets: ['env']
}))
.pipe(gulp.dest(calcDestDir));
}
6 changes: 5 additions & 1 deletion karma-coverage.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ module.exports = function(config) {
}
],

exclude: ['packages/metal-isomorphic/**/*.js'],

preprocessors: {
'packages/metal-incremental-dom/src/incremental-dom.js': ['browserify'],
'packages/metal-incremental-dom/lib/incremental-dom.js': ['browserify'],
Expand All @@ -77,7 +79,9 @@ module.exports = function(config) {
plugins: [
'istanbul'
],
presets: ['es2015']
presets: [
'env'
]
}
]
],
Expand Down
15 changes: 11 additions & 4 deletions karma-sauce.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ module.exports = function(config) {
}
],

exclude: ['packages/metal-isomorphic/**/*.js'],

preprocessors: {
'packages/metal-incremental-dom/src/incremental-dom.js': ['browserify'],
'packages/metal-incremental-dom/lib/incremental-dom.js': ['browserify'],
Expand All @@ -71,10 +73,15 @@ module.exports = function(config) {
browserify: {
debug: true,
transform: [
['babelify', {
presets: ['es2015']
}
]],
[
'babelify',
{
presets: [
'env'
]
}
]
],
insertGlobalVars: {
METAL_VERSION: function() {
return '\'' + lernaJson.version + '\'';
Expand Down
Loading

0 comments on commit cfe20c6

Please sign in to comment.