|
1 |
| -describe("Calendar Stuff", function() { |
2 |
| - var emailBuilder; |
3 |
| - |
4 |
| - beforeEach(function() { |
5 |
| - emailBuilder = new EmailBuilder(); |
6 |
| - }); |
7 |
| - |
8 |
| - describe('Something something', function() { |
9 |
| - var today; |
10 |
| - |
11 |
| - beforeEach(function() { |
12 |
| - today = new Date(); |
13 |
| - }); |
14 |
| - |
15 |
| - it('should be main entry', function() { |
16 |
| - var expected = '<strong>10:00</strong> AM'; |
17 |
| - var unit = 'hours'; |
18 |
| - var minutesFrom = 60; |
19 |
| - |
20 |
| - today.setHours(10, 0, 0, 0); |
21 |
| - var dateString = calendar.constructTimeEntry(today, minutesFrom, unit); |
22 |
| - |
23 |
| - expect(dateString.date).toBe('<strong>10:00</strong> AM'); |
24 |
| - }); |
25 |
| - |
26 |
| - |
27 |
| - }); |
28 |
| - |
29 |
| - |
30 |
| -}); |
| 1 | +'use strict'; |
| 2 | + |
| 3 | +var EmailBuilder = require('./'); |
| 4 | + |
| 5 | +/* |
| 6 | +======== A Handy Little Nodeunit Reference ======== |
| 7 | +https://github.com/caolan/nodeunit |
| 8 | +
|
| 9 | +Test methods: |
| 10 | +test.expect(numAssertions) |
| 11 | +test.done() |
| 12 | +Test assertions: |
| 13 | +test.ok(value, [message]) |
| 14 | +test.equal(actual, expected, [message]) |
| 15 | +test.notEqual(actual, expected, [message]) |
| 16 | +test.deepEqual(actual, expected, [message]) |
| 17 | +test.notDeepEqual(actual, expected, [message]) |
| 18 | +test.strictEqual(actual, expected, [message]) |
| 19 | +test.notStrictEqual(actual, expected, [message]) |
| 20 | +test.throws(block, [error], [message]) |
| 21 | +test.doesNotThrow(block, [error], [message]) |
| 22 | +test.ifError(value) |
| 23 | +*/ |
| 24 | + |
| 25 | +exports.init_gruntplugin_sample = { |
| 26 | + setUp: function(done) { |
| 27 | + // setup here if necessary |
| 28 | + |
| 29 | + var emailBuilder = new EmailBuilder(); |
| 30 | + |
| 31 | + done(); |
| 32 | + }, |
| 33 | + default_options: function(test) { |
| 34 | + |
| 35 | + var actual; |
| 36 | + var expected; |
| 37 | + |
| 38 | + test.expect(5); |
| 39 | + |
| 40 | + actual = grunt.file.read('reports/test-report'); |
| 41 | + expected = grunt.file.read('test/expected/test-report'); |
| 42 | + test.equal(actual, expected, 'Should produce a default report without DOM element for a test file'); |
| 43 | + |
| 44 | + actual = grunt.file.read('reports/test-report-dom'); |
| 45 | + expected = grunt.file.read('test/expected/test-report-dom'); |
| 46 | + test.equal(actual, expected, 'Should produce a default report with DOM element for a test file'); |
| 47 | + |
| 48 | + actual = grunt.file.read('reports/test-report.json'); |
| 49 | + expected = grunt.file.read('test/expected/test-report.json'); |
| 50 | + test.equal(actual, expected, 'Should produce JSON report without DOM element for a test file'); |
| 51 | + |
| 52 | + actual = grunt.file.read('reports/test-report-dom.json'); |
| 53 | + expected = grunt.file.read('test/expected/test-report-dom.json'); |
| 54 | + test.equal(actual, expected, 'Should produce JSON report with DOM element for a test file'); |
| 55 | + |
| 56 | + actual = grunt.file.read('reports/test-report-ignore.txt'); |
| 57 | + expected = grunt.file.read('test/expected/test-report-ignore.txt'); |
| 58 | + test.equal(actual, expected, 'Should ignore certain rules'); |
| 59 | + |
| 60 | + test.done(); |
| 61 | + } |
| 62 | +}; |
0 commit comments