Skip to content

Commit

Permalink
Make tests run in editor-build and deploy editor
Browse files Browse the repository at this point in the history
  • Loading branch information
RobinLinus committed Nov 3, 2015
1 parent 7c83011 commit 6afe998
Show file tree
Hide file tree
Showing 32 changed files with 208 additions and 121 deletions.
39 changes: 20 additions & 19 deletions bower.json
@@ -1,21 +1,22 @@
{
"name": "capira",
"private": true,
"dependencies": {
"polymer": "Polymer/polymer#^1.1.0",
"iron-elements": "PolymerElements/iron-elements#1.0.0",
"paper-elements": "PolymerElements/paper-elements#1.0.1",
"neon-elements": "PolymerElements/neon-elements#1.0.0",
"platinum-elements": "PolymerElements/platinum-elements#1.0.1",
"paper-dropdown-menu": "PolymerElements/paper-dropdown-menu#~1.0.2",
"paper-tooltip": "PolymerElements/paper-tooltip#~1.1.0",
"slang": "git@github.com:capira12/slang.git#master",
"katex": "0.5.1",
"page": "visionmedia/page.js#~1.6.3"
},
"devDependencies": {
"test-fixture": "PolymerElements/test-fixture#^1.0.0",
"web-component-tester": "*",
"hashids": "~1.0.2"
}
"name": "capira",
"private": true,
"dependencies": {
"polymer": "Polymer/polymer#^1.1.0",
"iron-elements": "PolymerElements/iron-elements#1.0.0",
"paper-elements": "PolymerElements/paper-elements#1.0.1",
"neon-elements": "PolymerElements/neon-elements#1.0.0",
"platinum-elements": "PolymerElements/platinum-elements#1.0.1",
"paper-dropdown-menu": "PolymerElements/paper-dropdown-menu#~1.0.2",
"paper-tooltip": "PolymerElements/paper-tooltip#~1.1.0",
"slang": "git@github.com:capira12/slang.git#master",
"katex": "0.5.1",
"page": "visionmedia/page.js#~1.6.3",
"iron-test-helpers": "PolymerElements/iron-test-helpers#~1.0.6"
},
"devDependencies": {
"test-fixture": "PolymerElements/test-fixture#^1.0.0",
"web-component-tester": "*",
"hashids": "~1.0.2"
}
}
22 changes: 11 additions & 11 deletions gulpfile.js
Expand Up @@ -478,28 +478,28 @@ gulp.task('copy-tests', function() {

var demos = gulp.src(['src/**/demo/*.html'])
.pipe($.if('*.html', $.replace(/<!-- build:js[^]* endbuild -->/, '<link rel="import" href="/editor/elements.html">')))
.pipe($.if('*.html', $.replace(/<link rel="import" href="..\/(.*)..\/overlays\/demo\/demo-init.html">/, '<link rel="import" href="../../overlay/demo/demo-init.html">')))
.pipe($.if('*.html', $.replace(/<link rel="import" href="..\/(.*)..\/overlays\/demo\/demo-init.html">/, '<link rel="import" href="../overlay/demo/demo-init.html">')))
.pipe(flatten({
includeParents: -2
}))
.pipe(gulp.dest('../dist/editor/test/'));
.pipe(gulp.dest('../dist/editor-test/'));

var demosPlayer = gulp.src(['src/**/demo/*.html', '!src/**/socrates-single-answer-quiz-editor/**/demo/*.html'])
var demosPlayer = gulp.src(['src/**/demo/*.html', '!src/**/socratic-single-answer-quiz-editor/**/demo/*.html'])
.pipe($.if('*.html', $.replace(/<!-- build:js[^]* endbuild -->/, '<link rel="import" href="/player/elements.html">')))
.pipe($.if('*.html', $.replace(/<link rel="import" href="..\/(.*)..\/overlays\/demo\/demo-init.html">/, '<link rel="import" href="../../overlay/demo/demo-init.html">')))
.pipe($.if('*.html', $.replace(/<link rel="import" href="..\/(.*)..\/overlays\/demo\/demo-init.html">/, '<link rel="import" href="../overlay/demo/demo-init.html">')))
.pipe(flatten({
includeParents: -2
}))
.pipe(gulp.dest('../dist/player/test/'));
.pipe(gulp.dest('../dist/player-test/'));
var testsPlayer = gulp.src('src/**/test/*.html')
.pipe($.if('*.html', $.replace(/<!-- build:js[^]* endbuild -->/, '<link rel="import" href="/player/elements.html">')))
.pipe(flatten({
includeParents: -2
}))
.pipe(gulp.dest('../dist/player/test/'));
.pipe(gulp.dest('../dist/player-test/'));
var htaccess = gulp.src('static/tests/.htaccess')
.pipe(gulp.dest('../dist/editor/test/'))
.pipe(gulp.dest('../dist/player/test/'));
.pipe(gulp.dest('../dist/editor-test/'))
.pipe(gulp.dest('../dist/player-test/'));
});


Expand All @@ -510,7 +510,7 @@ gulp.task('fetch-tests', function() {
.pipe(flatten({
includeParents: -2
}))
.pipe(gulp.dest('../dist/editor/test/'));
.pipe(gulp.dest('../dist/editor-test/'));
return gulp.src('src/**/test/index.html')
.pipe(flatten({
includeParents: -2
Expand All @@ -520,7 +520,7 @@ gulp.task('fetch-tests', function() {
gulp.task('print-tests', function() {
gulp.src('static/tests/all.html')
.pipe($.if('*.html', $.replace('/* tests */', JSON.stringify(filenames.get('testpaths')))))
.pipe(gulp.dest('../dist/editor/test/'));
.pipe(gulp.dest('../dist/editor-test/'));
});

gulp.task('build-tests', function(cb) {
Expand All @@ -545,7 +545,7 @@ gulp.task('build-tests', function(cb) {

gulp.task('fetch-player-tests', function() {
//Todo: exclude editor tests from player
return gulp.src(['src/**/test/index.html','!editor-tests'])
return gulp.src(/^((?!(-editor)).)*test\/index.html$/g)
.pipe(filenames('playerpaths'));
});

Expand Down
2 changes: 1 addition & 1 deletion showcase/crashy unit.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 6afe998

Please sign in to comment.