-
Notifications
You must be signed in to change notification settings - Fork 12
/
Gruntfile.coffee
100 lines (86 loc) · 2.51 KB
/
Gruntfile.coffee
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
module.exports = ->
# Project configuration
@initConfig
pkg: @file.readJSON 'package.json'
# CoffeeScript compilation
coffee:
spec:
options:
bare: true
expand: true
cwd: 'spec'
src: ['**.coffee']
dest: 'spec'
ext: '.js'
# Browser build of NoFlo
noflo_browser:
build:
files:
'browser/noflo-interaction.js': ['package.json']
# Automated recompilation and testing when developing
watch:
files: ['spec/*.coffee', 'components/*.coffee']
tasks: ['test']
# BDD tests on browser
mocha_phantomjs:
options:
output: 'spec/result.xml'
reporter: 'spec'
failWithOutput: true
all: ['spec/runner.html']
# Coding standards
coffeelint:
components:
files:
src: ['components/*.coffee']
options:
max_line_length:
value: 80
level: 'ignore'
# Cross-browser testing
connect:
server:
options:
base: ''
port: 9999
'saucelabs-mocha':
all:
options:
urls: ['http://127.0.0.1:9999/spec/runner.html']
browsers: [
browserName: 'chrome'
version: '55'
,
browserName: 'safari'
version: '10'
,
browserName: 'internet explorer'
version: '11'
]
build: process.env.TRAVIS_JOB_ID
testname: 'noflo-interaction browser tests'
tunnelTimeout: 5
concurrency: 1
detailedError: true
# Grunt plugins used for building
@loadNpmTasks 'grunt-noflo-browser'
@loadNpmTasks 'grunt-contrib-coffee'
# Grunt plugins used for testing
@loadNpmTasks 'grunt-contrib-watch'
@loadNpmTasks 'grunt-mocha-phantomjs'
@loadNpmTasks 'grunt-coffeelint'
# Grunt plugins used for browser testing
@loadNpmTasks 'grunt-contrib-connect'
@loadNpmTasks 'grunt-saucelabs'
# Our local tasks
@registerTask 'build', 'Build NoFlo for the chosen target platform', (target = 'all') =>
if target is 'all' or target is 'browser'
@task.run 'noflo_browser'
@registerTask 'test', 'Build NoFlo and run automated tests', (target = 'all') =>
@task.run 'coffeelint'
@task.run 'coffee'
@task.run 'build'
if target is 'all' or target is 'browser'
@task.run 'mocha_phantomjs'
@registerTask 'crossbrowser', 'Run tests on real browsers', ['test', 'connect', 'saucelabs-mocha']
@registerTask 'default', ['test']