Skip to content

Commit

Permalink
Added the velocity framework with mocha
Browse files Browse the repository at this point in the history
  • Loading branch information
matteodem committed Aug 15, 2014
1 parent 5076e12 commit e68ff9e
Show file tree
Hide file tree
Showing 23 changed files with 83 additions and 104 deletions.
2 changes: 2 additions & 0 deletions .meteor/packages
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,5 @@ accounts-ui
iron-router-progress
semantic-ui
collection2
velocity-html-reporter
mocha-web-velocity
34 changes: 17 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
# meteor-boilerplate

This boilerplate is here to give you a structure for typical meteor projects, with a console tool to ease up some tasks.
This boilerplate is here to give you a structure for typical meteor projects, with a console tool to ease up some tasks. Here's what you get
with it.

* meteor-boilerplate console tool, for scaffolding files and more
* Helpful packages included, for example [Iron Router](https://github.com/EventedMind/iron-router) and [Velocity](https://github.com/xolvio/velocity)
* Given folder structure to keep code clean

Here's what the boilerplate looks like: [boilerplate.meteor.com](http://boilerplate.meteor.com)

## How to install
Expand All @@ -20,46 +26,41 @@ node meteor-boilerplate # Lists all possible commands

### Packages used

* semantic-ui
* collection2
* standard-app-packages
* less
* jquery
* underscore
* handlebar-helpers
* iron-router
* iron-router-progress
* accounts-password
* accounts-ui
* iron-router-progress
* semantic-ui
* collection2
* velocity-html-reporter
* mocha-web-velocity

The "insecure" and "autopublish" packages are removed by default.
The "insecure" and "autopublish" packages are removed by default (they make your app vulnerable).

### Removing default code

There's already a lot of predefined code in this boilerplate, to show you the possible functionality. However, if you want to start off with an
empty project, use the provided command to get rid off all the code you don't need.

```bash
```sh
node meteor-boilerplate reset:project
```

### Coffeescript support

For all our coffeescript lovers, you can change to a coffeescript configuration for file generation like this.

```bash
```sh
node meteor-boilerplate change:profile coffee
```

Also use the ```reset:project``` command to start off with coffeescript files.

### Features

* Comprehensive folder structure
* TDD / BDD with [laika](http://arunoda.github.io/laika/)
* Multi page apps with [iron-router](https://github.com/EventedMind/iron-router)
* A way to load fixtures (as of now no external packages used for that)
* meteor-boilerplate console tool, which helps on creating views, routes and so on

### Folder structure

```
Expand All @@ -82,9 +83,8 @@ server/ # Server folder
lib/ # Server side library folder
publications/ # Collection publications(*)
startup/ # On server startup
tests/ # Test files, can be run with laika
tests/ # Velocity test files, can be run with mocha(*)
meteor-boilerplate # Command line tool
meteor-boilerplate.bat # Command line tool for windows
```

(*) = the command line tool creates files in these folders
Expand Down
10 changes: 5 additions & 5 deletions client/views/home/home.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ Template.home.helpers({
{ 'name' : 'Underscore', 'path' : 'http://underscorejs.org/' },
{ 'name' : 'Handlebar Helpers', 'path' : 'https://github.com/raix/Meteor-handlebar-helpers' },
{ 'name' : 'Iron Router Progress', 'path' : 'https://github.com/Multiply/iron-router-progress' },
{ 'name' : 'Accounts UI & Password', 'path' : 'http://docs.meteor.com/#accountsui' }
{ 'name' : 'Accounts UI & Password', 'path' : 'http://docs.meteor.com/#accountsui' },
{ 'name' : 'Velocity', 'path' : 'https://github.com/xolvio/velocity' }
];
},
'consoleCommand' : function () {
Expand All @@ -30,7 +31,7 @@ Template.home.helpers({
{ 'command' : 'create:route', 'description' : 'Creates a route javascript file under client/routes' },
{ 'command' : 'create:model', 'description' : 'Creates a model with files in model/, client/subscriptions and server/publications' },
{ 'command' : 'create:less', 'description' : 'Creates a less stylesheet in client/stylesheets' },
{ 'command' : 'create:test', 'description' : 'Creates test file under tests' },
{ 'command' : 'create:test', 'description' : 'Creates a velocity test file under tests' },
{ 'command' : 'reset:project', 'description' : 'Removes all unnecessary files, perfect for a fresh start' }
];
},
Expand All @@ -53,10 +54,9 @@ Template.home.helpers({
},
{ 'root' : 'model' },
{ 'root' : 'private' },
{ 'root' : 'server', 'children' : ['fixtures', 'lib', 'publications', 'startup', 'tests'] },
{ 'root' : 'server', 'children' : ['fixtures', 'lib', 'publications', 'startup'] },
{ 'root' : 'public' },
{ 'root' : 'meteor-boilerplate' },
{ 'root' : 'meteor-boilerplate.bat' }
{ 'root' : 'meteor-boilerplate' }
]
}
});
Expand Down
4 changes: 4 additions & 0 deletions packages/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,7 @@ iron-router-progress
/iron-layout
/iron-core
/iron-dynamic-template
/velocity-html-reporter
/velocity
/mocha-web-velocity
/mirror
2 changes: 1 addition & 1 deletion private/cli/coffee/create/test/configuration.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"files" : [
{
"template" : "test.coffee",
"path" : "tests/__testName__Test.coffee"
"path" : "tests/mocha-web-velocity/__testName__Test.coffee"
}
]
}
8 changes: 5 additions & 3 deletions private/cli/coffee/create/test/templates/test.coffee
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
assert = require 'assert'

suite '__testName__', ->
if typeof MochaWeb is not 'undefined'
MochaWeb.testOnly ->
describe "__testName__ Test Suite", ->
it "should let 5 + 5 be 10", ->
chai.assert.equal 5 + 5, 10
2 changes: 1 addition & 1 deletion private/cli/default/create/test/configuration.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"files" : [
{
"template" : "test.js",
"path" : "tests/__testName__Test.js"
"path" : "tests/mocha-web-velocity/__testName__Test.js"
}
]
}
13 changes: 9 additions & 4 deletions private/cli/default/create/test/templates/test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
var assert = require('assert');

suite('__testName__', function () {
});
if (!(typeof MochaWeb === 'undefined')){
MochaWeb.testOnly(function(){
describe("__testName__ Test Suite", function(){
it("should let 5 + 5 be 10", function(){
chai.assert.equal(5 + 5, 10);
});
});
});
}
3 changes: 0 additions & 3 deletions private/templates/layout.html

This file was deleted.

15 changes: 0 additions & 15 deletions private/templates/model.js

This file was deleted.

3 changes: 0 additions & 3 deletions private/templates/module.html

This file was deleted.

5 changes: 0 additions & 5 deletions private/templates/module.js

This file was deleted.

2 changes: 0 additions & 2 deletions private/templates/module.less

This file was deleted.

3 changes: 0 additions & 3 deletions private/templates/publication.js

This file was deleted.

10 changes: 0 additions & 10 deletions private/templates/route.js

This file was deleted.

1 change: 0 additions & 1 deletion private/templates/subscription.js

This file was deleted.

3 changes: 0 additions & 3 deletions private/templates/view.html

This file was deleted.

5 changes: 0 additions & 5 deletions private/templates/view.js

This file was deleted.

2 changes: 0 additions & 2 deletions private/templates/view.less

This file was deleted.

4 changes: 3 additions & 1 deletion smart.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
"handlebar-helpers": {},
"iron-router-progress": {},
"semantic-ui": {},
"collection2": {}
"collection2": {},
"velocity-html-reporter": {},
"mocha-web-velocity": {}
}
}
32 changes: 27 additions & 5 deletions smart.lock
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
"handlebar-helpers": {},
"iron-router-progress": {},
"semantic-ui": {},
"collection2": {}
"collection2": {},
"velocity-html-reporter": {},
"mocha-web-velocity": {}
},
"packages": {
"iron-router": {
Expand All @@ -31,8 +33,18 @@
},
"collection2": {
"git": "https://github.com/aldeed/meteor-collection2.git",
"tag": "v0.4.4",
"commit": "c70deb36e10f63238b884529eea1e38cf0789903"
"tag": "v0.4.6",
"commit": "80554182486be0d8e74f7ed02194a5649d712e27"
},
"velocity-html-reporter": {
"git": "https://github.com/rdickert/velocity-html-reporter.git",
"tag": "v0.1.4",
"commit": "55f973519fb6db831678219057854b94a4cec846"
},
"mocha-web-velocity": {
"git": "https://github.com/mad-eye/meteor-mocha-web.git",
"tag": "v0.3.4",
"commit": "5b68e18104c00687748b190b04a7752478472d17"
},
"iron-layout": {
"git": "https://github.com/EventedMind/iron-layout.git",
Expand All @@ -41,8 +53,18 @@
},
"simple-schema": {
"git": "https://github.com/aldeed/meteor-simple-schema.git",
"tag": "v0.6.0",
"commit": "418ec496612fb2afc853e342f0d2269b6674a2fe"
"tag": "v0.7.0",
"commit": "77d267aec4ba8a70f677e5d9ef9fb91fb0e3f0f6"
},
"velocity": {
"git": "https://github.com/xolvio/velocity.git",
"tag": "v0.1.18",
"commit": "1958c117417e832c3e9025088cca845b4a82728f"
},
"mirror": {
"git": "https://github.com/xdissent/meteor-mirror.git",
"tag": "v0.0.2",
"commit": "03d965dcab2f976a1fdc6ce513edcd4c17b75746"
},
"blaze-layout": {
"git": "https://github.com/EventedMind/blaze-layout.git",
Expand Down
15 changes: 0 additions & 15 deletions tests/dummyTest.js

This file was deleted.

9 changes: 9 additions & 0 deletions tests/mocha-web-velocity/dummyTest.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
if (!(typeof MochaWeb === 'undefined')){
MochaWeb.testOnly(function(){
describe("dummy Test Suite", function(){
it("should let 5 + 5 be 10", function(){
chai.assert.equal(5 + 5, 10);
});
});
});
}

0 comments on commit e68ff9e

Please sign in to comment.