summaryrefslogtreecommitdiff
path: root/node_modules/utile/test/format-test.js
diff options
context:
space:
mode:
authorMinteck <contact@minteck.org>2021-12-21 16:50:49 +0100
committerMinteck <contact@minteck.org>2021-12-21 16:50:49 +0100
commit20204baf1807825af4798ad03bfb329e4da05bc5 (patch)
tree1568515fa1e4592206ed5d2327b39e6b443cbd03 /node_modules/utile/test/format-test.js
downloadbingoloto-remote-20204baf1807825af4798ad03bfb329e4da05bc5.tar.gz
bingoloto-remote-20204baf1807825af4798ad03bfb329e4da05bc5.tar.bz2
bingoloto-remote-20204baf1807825af4798ad03bfb329e4da05bc5.zip
Commit
Diffstat (limited to 'node_modules/utile/test/format-test.js')
-rw-r--r--node_modules/utile/test/format-test.js31
1 files changed, 31 insertions, 0 deletions
diff --git a/node_modules/utile/test/format-test.js b/node_modules/utile/test/format-test.js
new file mode 100644
index 0000000..0648f5a
--- /dev/null
+++ b/node_modules/utile/test/format-test.js
@@ -0,0 +1,31 @@
+/*
+ * format-test.js: Tests for `utile.format` module.
+ *
+ * (C) 2011, Charlie Robbins & the Contributors
+ * MIT LICENSE
+ *
+ */
+
+var vows = require('vows'),
+ assert = require('assert'),
+ utile = require('../lib');
+
+vows.describe('utile/format').addBatch({
+
+ 'Should use the original `util.format` if there are no custom parameters to replace.': function() {
+ assert.equal(utile.format('%s %s %s', 'test', 'test2', 'test3'), 'test test2 test3');
+ },
+
+ 'Should use `utile.format` if custom parameters are provided.': function() {
+ assert.equal(utile.format('%a %b %c', [
+ '%a',
+ '%b',
+ '%c'
+ ], [
+ 'test',
+ 'test2',
+ 'test3'
+ ]), 'test test2 test3');
+ }
+
+}).export(module);