From cc4215367d2298f779ee9a5ab3f8c9cb6207c8c5 Mon Sep 17 00:00:00 2001 From: Joshua Peek Date: Fri, 19 Dec 2014 12:43:06 -0800 Subject: [PATCH] Avoid testing implementation specific error messages --- test/test.js | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/test/test.js b/test/test.js index 2a69d4b..9957e22 100644 --- a/test/test.js +++ b/test/test.js @@ -134,51 +134,47 @@ asyncTest('post sets content-type header', 2, function() { }) if (blobSupport) { - asyncTest('rejects blob promise after body is consumed', 3, function() { + asyncTest('rejects blob promise after body is consumed', 2, function() { fetch('/hello').then(function(response) { ok(response.blob, 'Body does not implement blob') response.blob() return response.blob() }).catch(function(error) { ok(error instanceof TypeError, 'Promise rejected after body consumed') - equal(error.message, 'Already read', 'Promise rejected for incorrect reason') start() }) }) } -asyncTest('rejects json promise after body is consumed', 3, function() { +asyncTest('rejects json promise after body is consumed', 2, function() { fetch('/json').then(function(response) { ok(response.json, 'Body does not implement json') response.json() return response.json() }).catch(function(error) { ok(error instanceof TypeError, 'Promise rejected after body consumed') - equal(error.message, 'Already read', 'Promise rejected for incorrect reason') start() }) }) -asyncTest('rejects text promise after body is consumed', 3, function() { +asyncTest('rejects text promise after body is consumed', 2, function() { fetch('/hello').then(function(response) { ok(response.text, 'Body does not implement text') response.text() return response.text() }).catch(function(error) { ok(error instanceof TypeError, 'Promise rejected after body consumed') - equal(error.message, 'Already read', 'Promise rejected for incorrect reason') start() }) }) -asyncTest('rejects formData promise after body is consumed', 3, function() { +asyncTest('rejects formData promise after body is consumed', 2, function() { fetch('/json').then(function(response) { ok(response.formData, 'Body does not implement formData') response.formData() return response.formData() }).catch(function(error) { ok(error instanceof TypeError, 'Promise rejected after body consumed') - equal(error.message, 'Already read', 'Promise rejected for incorrect reason') start() }) }) -- GitLab