[484] | 1 | /* |
---|
| 2 | ======== A Handy Little Nodeunit Reference ======== |
---|
| 3 | https://github.com/caolan/nodeunit |
---|
| 4 | |
---|
| 5 | Test methods: |
---|
| 6 | test.expect(numAssertions) |
---|
| 7 | test.done() |
---|
| 8 | Test assertions: |
---|
| 9 | test.ok(value, [message]) |
---|
| 10 | test.equal(actual, expected, [message]) |
---|
| 11 | test.notEqual(actual, expected, [message]) |
---|
| 12 | test.deepEqual(actual, expected, [message]) |
---|
| 13 | test.notDeepEqual(actual, expected, [message]) |
---|
| 14 | test.strictEqual(actual, expected, [message]) |
---|
| 15 | test.notStrictEqual(actual, expected, [message]) |
---|
| 16 | test.throws(block, [error], [message]) |
---|
| 17 | test.doesNotThrow(block, [error], [message]) |
---|
| 18 | test.ifError(value) |
---|
| 19 | */ |
---|
| 20 | |
---|
| 21 | var fs = require('fs'); |
---|
| 22 | // 0.4 specific test for twolfson/grunt-zip#6 |
---|
| 23 | exports['0.4'] = { |
---|
| 24 | 'dest-template': function (test) { |
---|
| 25 | test.expect(2); |
---|
| 26 | |
---|
| 27 | // Grab the stats on the file |
---|
| 28 | var file = __dirname + '/actual/template_zip/grunt-zip.zip'; |
---|
| 29 | fs.stat(file, function (err, stat) { |
---|
| 30 | // Assert there is no error |
---|
| 31 | test.equal(err, null, 'There was no error during `stat`'); |
---|
| 32 | |
---|
| 33 | // and we are looking at a file |
---|
| 34 | test.ok(stat.isFile, 'The templated zip file was not successfully created'); |
---|
| 35 | |
---|
| 36 | // Callback |
---|
| 37 | test.done(); |
---|
| 38 | }); |
---|
| 39 | } |
---|
| 40 | }; |
---|