Skip to content
This repository has been archived by the owner on Mar 26, 2018. It is now read-only.

Commit

Permalink
Make web-component-tester happy in Grunt and Gulp
Browse files Browse the repository at this point in the history
  • Loading branch information
robdodson committed Feb 10, 2015
1 parent ae4e354 commit b7ec3c2
Show file tree
Hide file tree
Showing 9 changed files with 20 additions and 14 deletions.
1 change: 1 addition & 0 deletions app/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ module.exports = yeoman.generators.Base.extend({
this.copy('gitattributes', '.gitattributes');
this.copy('bowerrc', '.bowerrc');
this.copy('bower.json', 'bower.json');
this.copy('wct.conf.js', 'wct.conf.js');
this.copy('jshintrc', '.jshintrc');
this.copy('editorconfig', '.editorconfig');
if (this.includeGulp) {
Expand Down
6 changes: 1 addition & 5 deletions app/templates/Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -260,10 +260,6 @@ module.exports = function (grunt) {
}
},
'wct-test': {
options: {
root: '.',
suite: ['<%%= yeoman.app %>/test']
},
local: {
options: {remote: false}
},
Expand Down Expand Up @@ -313,7 +309,7 @@ module.exports = function (grunt) {
]);
});

grunt.registerTask('test', ['wct-test:local']);
grunt.registerTask('test:local', ['wct-test:local']);
grunt.registerTask('test:remote', ['wct-test:remote']);
grunt.registerTask('build', [
Expand Down
6 changes: 3 additions & 3 deletions app/templates/_package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
"name": "<%= _.slugify(appname) %>",
"version": "0.0.0",
"dependencies": {},
"devDependencies": {<% if (includeGulp) { %>
"devDependencies": {
"web-component-tester": "^2.0.3",<% if (includeGulp) { %>
"apache-server-configs": "^2.7.1",
"browser-sync": "^1.3.0",
"del": "^0.1.2",
Expand Down Expand Up @@ -56,8 +57,7 @@
"jshint-stylish": "^1.0.0",
"load-grunt-tasks": "^2.0.0",
"serve-static": "^1.7.1",
"time-grunt": "^1.0.0",
"web-component-tester": "^2.0.3"<% } %>
"time-grunt": "^1.0.0"<% } %>
},
"engines": {
"node": ">=0.10.0"
Expand Down
4 changes: 4 additions & 0 deletions app/templates/gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -234,5 +234,9 @@ gulp.task('pagespeed', function (cb) {
}, cb);
});

// Load tasks for web-component-tester
// Adds tasks for `gulp test:local` and `gulp test:remote`
try { require('web-component-tester').gulp.init(gulp); } catch (err) {}

// Load custom tasks from the `tasks` directory
try { require('require-dir')('tasks'); } catch (err) {}
4 changes: 2 additions & 2 deletions app/templates/test/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
<title>Core Elements Test Runner</title>
<meta charset="UTF-8">

<script src="../bower_components/webcomponentsjs/webcomponents.js"></script>
<script src="../bower_components/web-component-tester/browser.js"></script>
<script src="../../bower_components/webcomponentsjs/webcomponents.js"></script>
<script src="../../bower_components/web-component-tester/browser.js"></script>
</head>

<body>
Expand Down
4 changes: 2 additions & 2 deletions app/templates/test/yo-greeting-basic.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
<meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1.0, user-scalable=yes">
<title>yo-greeting-basic</title>

<script src="../bower_components/webcomponentsjs/webcomponents.js"></script>
<script src="../bower_components/web-component-tester/browser.js"></script>
<script src="../../bower_components/webcomponentsjs/webcomponents.js"></script>
<script src="../../bower_components/web-component-tester/browser.js"></script>

<!-- Step 1: import the element to test -->
<link rel="import" href="../elements/yo-greeting/yo-greeting.html">
Expand Down
4 changes: 2 additions & 2 deletions app/templates/test/yo-list-basic.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
<meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1.0, user-scalable=yes">
<title>yo-list-basic</title>

<script src="../bower_components/webcomponentsjs/webcomponents.js"></script>
<script src="../bower_components/web-component-tester/browser.js"></script>
<script src="../../bower_components/webcomponentsjs/webcomponents.js"></script>
<script src="../../bower_components/web-component-tester/browser.js"></script>

<!-- Step 1: import the element to test -->
<link rel="import" href="../elements/yo-list/yo-list.html">
Expand Down
4 changes: 4 additions & 0 deletions app/templates/wct.conf.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
module.exports = {
root: '.',
suites: ['app/test']
};
1 change: 1 addition & 0 deletions test/app-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ describe('yo polymer:app test', function () {
var expected = [
'bower.json',
'package.json',
'wct.conf.js',
'.bowerrc',
'.editorconfig',
'.gitattributes',
Expand Down

0 comments on commit b7ec3c2

Please sign in to comment.