How to use the intern/dojo/json.stringify function in intern

To help you get started, we’ve selected a few intern examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github persvr / rql / test / query.js View on Github external
testBindParameters: function () {
			// TODO
			var parsed;
			parsed = parseQuery('in(id,$1)', [['a','b','c']]);
			assert.strictEqual(JSON.stringify(parsed), JSON.stringify({
				name: 'and',
				args: [{ name: 'in', args: [ 'id', [ 'a', 'b', 'c' ]]}],
				cache: {}
			}));
			parsed = parseQuery('eq(id,$1)', [ 'a' ]);
			assert.deepEqual(JSON.stringify(parsed), JSON.stringify({
				name: 'and',
				args: [{ name: 'eq', args: ['id', 'a']}],
				cache: {id: 'a'}
			}));
		},
github persvr / rql / test / query.js View on Github external
delete actual.cache;
							}

							if (typeof expected === 'string') {
								expected = parseQuery(expected);
							}

							if (!hasKeys(expected.cache)) {
								delete expected.cache;
							}

							// someone decided that matching constructors is necessary for deep equality
							// see https://github.com/theintern/intern/issues/284
							// the deepEqual assertion also fails due to properties like toString so this assertion seems to
							// be the most suitable.
							assert.strictEqual(JSON.stringify(actual), JSON.stringify(expected));
						};
					};
github persvr / rql / test / query.js View on Github external
testBindParameters: function () {
			// TODO
			var parsed;
			parsed = parseQuery('in(id,$1)', [['a','b','c']]);
			assert.strictEqual(JSON.stringify(parsed), JSON.stringify({
				name: 'and',
				args: [{ name: 'in', args: [ 'id', [ 'a', 'b', 'c' ]]}],
				cache: {}
			}));
			parsed = parseQuery('eq(id,$1)', [ 'a' ]);
			assert.deepEqual(JSON.stringify(parsed), JSON.stringify({
				name: 'and',
				args: [{ name: 'eq', args: ['id', 'a']}],
				cache: {id: 'a'}
			}));
		},