-
Notifications
You must be signed in to change notification settings - Fork 1
/
Gruntfile.coffee
51 lines (41 loc) · 1.27 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
module.exports = ->
# Project configuration
@initConfig
pkg: @file.readJSON 'package.json'
# BDD tests on Node.js
mochaTest:
nodejs:
src: ['spec/*.coffee']
options:
reporter: 'spec'
require: 'coffee-script/register'
# Web server for the browser tests
connect:
server:
options:
port: 8000
# BDD tests on browser
mocha_phantomjs:
all:
options:
output: 'test/result.xml'
reporter: 'spec'
urls: ['http://localhost:8000/test/runner.html']
# Grunt plugins used for building
@loadNpmTasks 'grunt-contrib-clean'
# Grunt plugins used for testing
@loadNpmTasks 'grunt-contrib-connect'
@loadNpmTasks 'grunt-mocha-test'
@loadNpmTasks 'grunt-mocha-phantomjs'
@loadNpmTasks 'grunt-exec'
# Our local tasks
@registerTask 'build', 'Build MicroFlo for the chosen target platform', (target = 'all') =>
# @task.run 'coffee'
@registerTask 'test', 'Build MicroFlo and run automated tests', (target = 'all') =>
@task.run 'build'
if target is 'all' or target is 'nodejs'
@task.run 'mochaTest'
# if target is 'all' or target is 'browser'
#@task.run 'connect'
#@task.run 'mocha_phantomjs'
@registerTask 'default', ['test']