Permalink
Browse files

bump deps, use tap

  • Loading branch information...
1 parent cc92844 commit 804286594749766c900e53289cb1efbbcb705adc @substack committed Jun 8, 2012
Showing with 26 additions and 23 deletions.
  1. +5 −6 package.json
  2. +21 −17 test/stub.js
View
11 package.json
@@ -1,22 +1,21 @@
{
"name" : "jsup",
- "version" : "0.0.0",
+ "version" : "0.0.1",
"description" : "modify json files in-place, preserving formatting",
"main" : "index.js",
"directories" : {
- "lib" : ".",
"example" : "example",
"test" : "test"
},
"dependencies" : {
- "burrito" : ">=0.2.5 <0.3",
- "traverse" : ">=0.4.3 <0.5"
+ "burrito" : "~0.2.12",
+ "traverse" : "~0.6.1"
},
"devDependencies" : {
- "expresso" : "0.7.x"
+ "tap" : "~0.2.5"
},
"scripts" : {
- "test" : "expresso"
+ "test" : "tap test/*.js"
},
"repository" : {
"type" : "git",
View
38 test/stub.js
@@ -1,44 +1,46 @@
-var assert = require('assert');
-var fs = require('fs');
var jsup = require('../');
+var test = require('tap').test;
+var fs = require('fs');
var src = fs.readFileSync(__dirname + '/stub.json', 'utf8');
-exports.stub = function () {
- assert.equal(jsup(src).stringify(), src);
+test('stub', function (t) {
+ t.equal(jsup(src).stringify(), src);
- assert.equal(
+ t.equal(
jsup(src)
.set([ 'a', 2 ], 'Three')
.stringify()
,
src.replace('"three"', '"Three"')
);
- assert.equal(
+ t.equal(
jsup(src)
.set([ 'a', 2 ], 'Three')
.set([ 'c' ], 'lul')
.stringify()
,
src.replace('three', 'Three').replace('444444', '"lul"')
);
-};
+
+ t.end();
+});
-exports.get = function () {
+test('get', function (t) {
var js = jsup(src)
.set([ 'a', 2 ], 3)
.set([ 'c' ], 'lul')
;
- assert.equal(js.get([ 'a', 0 ]), 1);
- assert.equal(js.get([ 'a', 1 ]), 2);
- assert.equal(js.get([ 'a', 2 ]), 3);
- assert.deepEqual(js.get([ 'a' ]), [ 1, 2, 3 ]);
+ t.equal(js.get([ 'a', 0 ]), 1);
+ t.equal(js.get([ 'a', 1 ]), 2);
+ t.equal(js.get([ 'a', 2 ]), 3);
+ t.same(js.get([ 'a' ]), [ 1, 2, 3 ]);
- assert.equal(js.get([ 'c' ]), 'lul');
- assert.ok(js.get([ 'd' ]) === null);
+ t.equal(js.get([ 'c' ]), 'lul');
+ t.ok(js.get([ 'd' ]) === null);
- assert.deepEqual(
+ t.same(
js.get([]),
{
a : [ 1, 2, 3 ],
@@ -48,7 +50,7 @@ exports.get = function () {
}
);
- assert.deepEqual(
+ t.same(
js.get(),
{
a : [ 1, 2, 3 ],
@@ -57,4 +59,6 @@ exports.get = function () {
d : null
}
);
-};
+
+ t.end();
+});

0 comments on commit 8042865

Please sign in to comment.