File: template-sync-test.js

package info (click to toggle)
node-tmp 0.2.2%2Bdfsg%2B~0.2.3-1.1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 796 kB
  • sloc: javascript: 1,562; sh: 18; makefile: 2
file content (28 lines) | stat: -rw-r--r-- 758 bytes parent folder | download | duplicates (5)
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
/* eslint-disable no-octal */
// vim: expandtab:ts=2:sw=2

const
  assert = require('assert'),
  tmp = require('../lib/tmp');

describe('tmp', function () {
  describe('dirSync()', function () {
    it('with invalid template', function () {
      try {
        tmp.dirSync({template:'invalid'});
      } catch (err) {
        assert.equal(err.message, 'Invalid template, found "invalid".', 'should have thrown the expected error');
      }
    });
  });

  describe('fileSync()', function () {
    it('with invalid template', function () {
      try {
        tmp.fileSync({template:'invalid'});
      } catch (err) {
        assert.equal(err.message, 'Invalid template, found "invalid".', 'should have thrown the expected error');
      }
    });
  });
});