Skip to content
This repository has been archived by the owner on May 11, 2019. It is now read-only.

Commit

Permalink
Using a non-core node module
Browse files Browse the repository at this point in the history
  • Loading branch information
Emilien Kenler committed Mar 14, 2014
1 parent 6c77123 commit 9b095fc
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
3 changes: 3 additions & 0 deletions app/scripts/controllers/main.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
'use strict';

var fs = require('fs');
var _ = require('underscore');

angular.module('packageApp')
.controller('MainCtrl', function ($scope) {
Expand All @@ -11,4 +12,6 @@ angular.module('packageApp')
];

$scope.home = fs.readdirSync(process.env.HOME);

$scope.shuffle = _.shuffle([1, 2, 3, 4, 5, 6]);
});
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
{
"name": "nodewebkittest",
"version": "0.0.0",
"dependencies": {},
"dependencies": {
"underscore": "~1.6.0"
},
"devDependencies": {
"grunt": "~0.4.1",
"grunt-autoprefixer": "~0.4.0",
Expand Down
4 changes: 4 additions & 0 deletions test/spec/controllers/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,8 @@ describe('Controller: MainCtrl', function () {
it('should attach a list of files to the scope', function () {
expect(scope.home).toContain('Applications');
});

it('should attach a list of numbers to the scope', function () {
expect(scope.shuffle.length).toBe(6);
});
});

0 comments on commit 9b095fc

Please sign in to comment.