1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-12-23 22:42:10 +03:00

utils.failTest -> nodeify

Automated replacement of utils.failTest with nodeify

This was done with the perl incantation:

```
    find spec -name '*.js' |
        xargs perl -i -pe 's/catch\((testUtils|utils).failTest\).done\(done\)/nodeify(done)/'
```

more auto
This commit is contained in:
Richard van der Hoff
2017-07-10 16:33:40 +01:00
parent 3294f4858a
commit 5ab0930de8
7 changed files with 38 additions and 38 deletions

View File

@@ -79,7 +79,7 @@ describe("MatrixClient", function() {
const uploads = client.getCurrentUploads();
expect(uploads.length).toEqual(0);
}).catch(utils.failTest).done(done);
}).nodeify(done);
httpBackend.flush();
});
@@ -99,7 +99,7 @@ describe("MatrixClient", function() {
rawResponse: false,
}).then(function(response) {
expect(response.content_uri).toEqual("uri");
}).catch(utils.failTest).done(done);
}).nodeify(done);
httpBackend.flush();
});
@@ -125,7 +125,7 @@ describe("MatrixClient", function() {
expect(error.httpStatus).toEqual(400);
expect(error.errcode).toEqual("M_SNAFU");
expect(error.message).toEqual("broken");
}).catch(utils.failTest).done(done);
}).nodeify(done);
httpBackend.flush();
});
@@ -149,7 +149,7 @@ describe("MatrixClient", function() {
const uploads = client.getCurrentUploads();
expect(uploads.length).toEqual(0);
}).catch(utils.failTest).done(done);
}).nodeify(done);
const r = client.cancelUpload(prom);
expect(r).toBe(true);
@@ -381,7 +381,7 @@ describe("MatrixClient", function() {
algorithms: ["2"],
unsigned: { "ghi": "def" },
});
}).catch(utils.failTest).done(done);
}).nodeify(done);
httpBackend.flush();
});
@@ -398,7 +398,7 @@ describe("MatrixClient", function() {
client.deleteDevice(
"my_device", auth,
).catch(utils.failTest).done(done);
).nodeify(done);
httpBackend.flush();
});