-
Notifications
You must be signed in to change notification settings - Fork 92
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add initial suite of missing template tests
- Loading branch information
1 parent
cf037ec
commit 430b7a1
Showing
2 changed files
with
66 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/* eslint-disable no-octal */ | ||
// vim: expandtab:ts=2:sw=2 | ||
|
||
const | ||
assert = require('assert'), | ||
inbandStandardTests = require('./name-inband-standard'), | ||
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 provided', '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 provided', 'should have thrown the expected error'); | ||
} | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/* eslint-disable no-octal */ | ||
// vim: expandtab:ts=2:sw=2 | ||
|
||
const | ||
assert = require('assert'), | ||
inbandStandardTests = require('./name-inband-standard'), | ||
tmp = require('../lib/tmp'); | ||
|
||
|
||
describe('tmp', function () { | ||
describe('dir()', function () { | ||
it('with invalid template', function (done) { | ||
tmp.dir({template:'invalid'}, function (err, result) { | ||
if (!err) return done(new Error('err expected')); | ||
try { | ||
assert.equal(err.message, 'Invalid template provided', 'should have thrown the expected error'); | ||
} catch (err2) { | ||
done(err); | ||
} | ||
done(); | ||
}); | ||
}); | ||
}); | ||
describe('file()', function () { | ||
it('with invalid template', function (done) { | ||
tmp.file({template:'invalid'}, function (err, result) { | ||
if (!err) return done(new Error('err expected')); | ||
try { | ||
assert.equal(err.message, 'Invalid template provided', 'should have thrown the expected error'); | ||
} catch (err2) { | ||
done(err); | ||
} | ||
done(); | ||
}); | ||
}); | ||
}); | ||
}); |