Example #1
0
File: xhr.ts Project: dasa/typings
	'.get json with falsy value': function () {
		var def = this.async(),
			promise = xhr.get(dojoRequire.toUrl('./support/falsy.json'), {
				preventCache: true,
				handleAs: 'json'
			});

		promise.then(
			def.callback(function (response) {
				assert.strictEqual(response, false);
			})
		);
	},
Example #2
0
File: xhr.ts Project: dasa/typings
	'.get 404': function () {
		var def = this.async(),
			promise = xhr.get(dojoRequire.toUrl('./xhr_blarg.html'), {
				preventCache: true
			});

		promise.response.then(
			def.reject,
			def.callback(function (error) {
				assert.strictEqual(error.response.status, 404);
			})
		);
	},