Skip to content

Commit 9e3438f

Browse files
committed
Merge branch 'runner-improve' into browserify
2 parents 00251e5 + a80fbc1 commit 9e3438f

99 files changed

Lines changed: 1404906 additions & 505 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@ matter-doc-theme
66
build/matter-dev.js
77
build/matter-dev.min.js
88
demo/js/lib/matter-dev.js
9+
test/browser/diffs

.jshintrc

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,18 @@
2525
"sub" : false, // Tolerate all forms of subscript notation besides dot notation e.g. `dict['key']` instead of `dict.key`.
2626
"trailing" : false, // Prohibit trailing whitespaces.
2727
"white" : false, // Check against strict whitespace and indentation rules.
28-
"indent" : 4 // Specify indentation spacing
28+
"indent" : 4, // Specify indentation spacing
29+
30+
// variables
31+
"undef": true,
32+
"-W079": true, // Silence redefinition errors (they are false positives).
33+
"predef": [
34+
"Matter", "window", "document", "Element", "MatterTools", "PIXI", "phantom", "module",
35+
"$", "Image", "navigator", "setTimeout", "decomp", "HTMLElement", "require",
36+
"Body", "Composite", "World", "Contact", "Detector", "Grid",
37+
"Pairs", "Pair", "Resolver", "SAT", "Constraint", "MouseConstraint",
38+
"Common", "Engine", "Mouse", "Sleeping", "Bodies", "Composites",
39+
"Axes", "Bounds", "Vector", "Vertices", "Render", "RenderPixi",
40+
"Events", "Query", "Runner", "Svg", "Metrics"
41+
]
2942
}

.npmignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1+
.idea
12
node_modules
23
npm-debug.log
34
doc
45
matter-doc-theme
56
build/matter-dev.js
67
build/matter-dev.min.js
7-
demo/js/lib/matter-dev.js
8+
demo/js/lib/matter-dev.js
9+
test/browser/diffs

.travis.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
language: node_js
2+
sudo: false
23
node_js:
34
- "0.10"
4-
before_install: npm install -g grunt-cli
5-
install: npm install
6-
before_script: grunt
5+
before_install:
6+
- npm install -g grunt-cli
7+
- mkdir travis-phantomjs
8+
- wget https://s3.amazonaws.com/travis-phantomjs/phantomjs-2.0.0-ubuntu-12.04.tar.bz2 -O $PWD/travis-phantomjs/phantomjs-2.0.0-ubuntu-12.04.tar.bz2
9+
- tar -xvf $PWD/travis-phantomjs/phantomjs-2.0.0-ubuntu-12.04.tar.bz2 -C $PWD/travis-phantomjs
10+
- export PATH=$PWD/travis-phantomjs:$PATH
11+
install: npm install

Gruntfile.js

Lines changed: 34 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ module.exports = function(grunt) {
4545
options: {
4646
jshintrc: '.jshintrc'
4747
},
48-
all: ['src/**/*.js', 'demo/js/*.js', '!src/module/*']
48+
all: ['src/**/*.js', 'demo/js/*.js', 'test/browser/TestDemo.js', '!src/module/*']
4949
},
5050
connect: {
5151
watch: {
@@ -54,6 +54,11 @@ module.exports = function(grunt) {
5454
open: 'http://localhost:9000/demo/dev.html',
5555
livereload: 9001
5656
}
57+
},
58+
serve: {
59+
options: {
60+
port: 8000
61+
}
5762
}
5863
},
5964
watch: {
@@ -95,6 +100,19 @@ module.exports = function(grunt) {
95100
src: 'build/<%= buildName %>.js',
96101
dest: 'build/<%= buildName %>.js'
97102
}
103+
},
104+
shell: {
105+
testDemo: {
106+
command: function(arg) {
107+
arg = arg ? ' --' + arg : '';
108+
return 'phantomjs test/browser/TestDemo.js' + arg;
109+
},
110+
options: {
111+
execOptions: {
112+
timeout: 1000 * 60
113+
}
114+
}
115+
}
98116
}
99117
});
100118

@@ -106,11 +124,25 @@ module.exports = function(grunt) {
106124
grunt.loadNpmTasks('grunt-contrib-copy');
107125
grunt.loadNpmTasks('grunt-contrib-yuidoc');
108126
grunt.loadNpmTasks('grunt-preprocess');
127+
grunt.loadNpmTasks('grunt-shell');
109128

110129
grunt.registerTask('default', ['test', 'build']);
111-
grunt.registerTask('test', ['jshint']);
130+
grunt.registerTask('test', ['build:dev', 'connect:serve', 'jshint', 'test:demo']);
112131
grunt.registerTask('dev', ['build:dev', 'connect:watch', 'watch']);
113132

133+
grunt.registerTask('test:demo', function() {
134+
var updateAll = grunt.option('updateAll'),
135+
diff = grunt.option('diff');
136+
137+
if (updateAll) {
138+
grunt.task.run('shell:testDemo:updateAll');
139+
} else if (diff) {
140+
grunt.task.run('shell:testDemo:diff');
141+
} else {
142+
grunt.task.run('shell:testDemo');
143+
}
144+
});
145+
114146
grunt.registerTask('build', function(mode) {
115147
var isDev = (mode === 'dev'),
116148
isRelease = (mode === 'release'),

0 commit comments

Comments
 (0)