Sha256: b09a219d4a519d3be76f345b56f4e6fe0efef0beb64935a51e623c1adb369830

Contents?: true

Size: 696 Bytes

Versions: 89

Compression:

Stored size: 696 Bytes

Contents

var assert = require('better-assert');
var expect = require('expect.js');
var parsejson = require('./index.js');

describe('my suite', function(){
	it('should parse a JSON string', function () {
		
		var jsonString =  '{"users" :[{"first_name":"foo", "last_name":"bar"}],' +
						   '"id"    :40,' + 
						   '"cities":["los angeles", "new york", "boston"]}';
		
		var jsonObj = parsejson(jsonString);
		expect(jsonObj.users[0].first_name).to.be("foo");
		expect(jsonObj.users[0].last_name).to.be("bar");
		expect(jsonObj.id).to.be(40);
		expect(jsonObj.cities[0]).to.be('los angeles');
		expect(jsonObj.cities[1]).to.be('new york');
		expect(jsonObj.cities[2]).to.be('boston');
				
  });
});

Version data entries

89 entries across 89 versions & 3 rubygems

Version Path
flok-0.0.68 spec/iface/driver/assets/node_modules/socket.io/node_modules/socket.io-client/node_modules/engine.io-client/node_modules/parsejson/test.js
flok-0.0.67 spec/iface/driver/assets/node_modules/socket.io/node_modules/socket.io-client/node_modules/engine.io-client/node_modules/parsejson/test.js
flok-0.0.66 spec/iface/driver/assets/node_modules/socket.io/node_modules/socket.io-client/node_modules/engine.io-client/node_modules/parsejson/test.js
flok-0.0.65 spec/iface/driver/assets/node_modules/socket.io/node_modules/socket.io-client/node_modules/engine.io-client/node_modules/parsejson/test.js
flok-0.0.64 spec/iface/driver/assets/node_modules/socket.io/node_modules/socket.io-client/node_modules/engine.io-client/node_modules/parsejson/test.js
flok-0.0.63 spec/iface/driver/assets/node_modules/socket.io/node_modules/socket.io-client/node_modules/engine.io-client/node_modules/parsejson/test.js
flok-0.0.62 spec/iface/driver/assets/node_modules/socket.io/node_modules/socket.io-client/node_modules/engine.io-client/node_modules/parsejson/test.js
flok-0.0.61 spec/iface/driver/assets/node_modules/socket.io/node_modules/socket.io-client/node_modules/engine.io-client/node_modules/parsejson/test.js
flok-0.0.60 spec/iface/driver/assets/node_modules/socket.io/node_modules/socket.io-client/node_modules/engine.io-client/node_modules/parsejson/test.js
flok-0.0.57 spec/iface/driver/assets/node_modules/socket.io/node_modules/socket.io-client/node_modules/engine.io-client/node_modules/parsejson/test.js
flok-0.0.56 spec/iface/driver/assets/node_modules/socket.io/node_modules/socket.io-client/node_modules/engine.io-client/node_modules/parsejson/test.js
flok-0.0.55 spec/iface/driver/assets/node_modules/socket.io/node_modules/socket.io-client/node_modules/engine.io-client/node_modules/parsejson/test.js
flok-0.0.54 spec/iface/driver/assets/node_modules/socket.io/node_modules/socket.io-client/node_modules/engine.io-client/node_modules/parsejson/test.js
flok-0.0.53 spec/iface/driver/assets/node_modules/socket.io/node_modules/socket.io-client/node_modules/engine.io-client/node_modules/parsejson/test.js
flok-0.0.52 spec/iface/driver/assets/node_modules/socket.io/node_modules/socket.io-client/node_modules/engine.io-client/node_modules/parsejson/test.js
flok-0.0.51 spec/iface/driver/assets/node_modules/socket.io/node_modules/socket.io-client/node_modules/engine.io-client/node_modules/parsejson/test.js
flok-0.0.50 spec/iface/driver/assets/node_modules/socket.io/node_modules/socket.io-client/node_modules/engine.io-client/node_modules/parsejson/test.js
flok-0.0.49 spec/iface/driver/assets/node_modules/socket.io/node_modules/socket.io-client/node_modules/engine.io-client/node_modules/parsejson/test.js
flok-0.0.48 spec/iface/driver/assets/node_modules/socket.io/node_modules/socket.io-client/node_modules/engine.io-client/node_modules/parsejson/test.js
flok-0.0.47 spec/iface/driver/assets/node_modules/socket.io/node_modules/socket.io-client/node_modules/engine.io-client/node_modules/parsejson/test.js