Skip to content

Even faster tests #4868

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jul 3, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion spec/AuthenticationAdapters.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ describe('AuthenticationProviders', function() {
})
});

it('properly loads custom adapter module object', (done) => {
it('properly loads custom adapter module object (again)', (done) => {
const authenticationHandler = authenticationLoader({
customAuthentication: { module: path.resolve('./spec/support/CustomAuthFunction.js'), options: { token: 'valid-token' }}
});
Expand Down
15 changes: 0 additions & 15 deletions spec/HTTPRequest.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,21 +132,6 @@ describe("httpRequest", () => {
});
})

it("should fail on 404", (done) => {
httpRequest({
url: httpRequestServer + "/404",
}).then(function(){
fail("should not succeed");
done();
}, function(httpResponse){
expect(httpResponse.status).toBe(404);
expect(httpResponse.buffer).toEqual(new Buffer('NO'));
expect(httpResponse.text).toEqual('NO');
expect(httpResponse.data).toBe(undefined);
done();
})
})

it("should post on echo", (done) => {
let calls = 0;
httpRequest({
Expand Down
4 changes: 2 additions & 2 deletions spec/JobSchedule.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,11 @@ describe('JobSchedule', () => {
rp.put(Parse.serverURL + '/cloud_code/jobs/jobId', defaultOptions).then(done.fail, () => done());
});

it('should reject access when not using masterKey (PUT /jobs/id)', (done) => {
it('should reject access when not using masterKey (DELETE /jobs/id)', (done) => {
rp.del(Parse.serverURL + '/cloud_code/jobs/jobId', defaultOptions).then(done.fail, () => done());
});

it('should allow access when using masterKey (/jobs)', (done) => {
it('should allow access when using masterKey (GET /jobs)', (done) => {
rp.get(Parse.serverURL + '/cloud_code/jobs', masterKeyOptions).then(done, done.fail);
});

Expand Down
6 changes: 3 additions & 3 deletions spec/LoggerController.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ const LoggerController = require('../lib/Controllers/LoggerController').LoggerCo
const WinstonLoggerAdapter = require('../lib/Adapters/Logger/WinstonLoggerAdapter').WinstonLoggerAdapter;

describe('LoggerController', () => {
it('can check process a query without throwing', (done) => {
it('can process an empty query without throwing', (done) => {
// Make mock request
const query = {};

Expand Down Expand Up @@ -37,7 +37,7 @@ describe('LoggerController', () => {
done();
});

it('can process a query without throwing', (done) => {
it('can process an ascending query without throwing', (done) => {
// Make mock request
const query = {
from: "2016-01-01Z00:00:00",
Expand All @@ -58,7 +58,7 @@ describe('LoggerController', () => {
done();
});

it('can check process a query without throwing', (done) => {
it('can process a descending query without throwing', (done) => {
// Make mock request
const query = {
from: "2016-01-01",
Expand Down
2 changes: 1 addition & 1 deletion spec/MongoStorageAdapter.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const databaseURI = 'mongodb://localhost:27017/parseServerMongoAdapterTestDataba
describe_only_db('mongo')('MongoStorageAdapter', () => {
beforeEach(done => {
new MongoStorageAdapter({ uri: databaseURI })
.dropDatabase()
.deleteAllClasses()
.then(done, fail);
});

Expand Down
2 changes: 1 addition & 1 deletion spec/MongoTransform.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ describe('parseObjectToMongoObjectForCreate', () => {
done();
});

it('built-in timestamps', (done) => {
it('built-in timestamps with date', (done) => {
const input = {
createdAt: "2015-10-06T21:24:50.332Z",
updatedAt: "2015-10-06T21:24:50.332Z"
Expand Down
18 changes: 0 additions & 18 deletions spec/ParseFile.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -632,24 +632,6 @@ describe('Parse.File testing', () => {
});
});

it('fails to upload without a file name', done => {
const headers = {
'Content-Type': 'application/octet-stream',
'X-Parse-Application-Id': 'test',
'X-Parse-REST-API-Key': 'rest'
};
request.post({
headers: headers,
url: 'http://localhost:8378/1/files/',
body: 'yolo',
}, (error, response, body) => {
expect(error).toBe(null);
expect(response.statusCode).toBe(400);
expect(body).toEqual('{"code":122,"error":"Filename not provided."}');
done();
});
});

it('fails to delete an unkown file', done => {
const headers = {
'Content-Type': 'application/octet-stream',
Expand Down
2 changes: 1 addition & 1 deletion spec/ParseHooks.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ describe('Hooks', () => {
});
});

it("should run the function on the test server", (done) => {
it("should run the function on the test server (error handling)", (done) => {

app.post("/SomeFunctionError", function(req, res) {
res.json({error: {code: 1337, error: "hacking that one!"}});
Expand Down
Loading