Skip to content

Commit 5f991e9

Browse files
Arthur Cinaderflovilmart
authored andcommitted
chore: put loose test into a describe block where it belongs... (#3920)
1 parent 4aa4ebe commit 5f991e9

File tree

1 file changed

+17
-18
lines changed

1 file changed

+17
-18
lines changed

spec/CloudCodeLogger.spec.js

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
'use strict';
2-
var LoggerController = require('../src/Controllers/LoggerController').LoggerController;
3-
var WinstonLoggerAdapter = require('../src/Adapters/Logger/WinstonLoggerAdapter').WinstonLoggerAdapter;
4-
1+
const LoggerController = require('../src/Controllers/LoggerController').LoggerController;
2+
const WinstonLoggerAdapter = require('../src/Adapters/Logger/WinstonLoggerAdapter').WinstonLoggerAdapter;
53
const fs = require('fs');
4+
65
const loremFile = __dirname + '/support/lorem.txt';
76

87
describe("Cloud Code Logger", () => {
@@ -227,21 +226,21 @@ describe("Cloud Code Logger", () => {
227226
})
228227
.then(null, e => done.fail(JSON.stringify(e)));
229228
}).pend('needs more work.....');
230-
});
231229

232-
it('cloud function should obfuscate password', done => {
233-
const logController = new LoggerController(new WinstonLoggerAdapter());
230+
it('cloud function should obfuscate password', done => {
231+
const logController = new LoggerController(new WinstonLoggerAdapter());
234232

235-
Parse.Cloud.define('testFunction', (req, res) => {
236-
res.success(1002,'verify code success');
237-
});
233+
Parse.Cloud.define('testFunction', (req, res) => {
234+
res.success(1002,'verify code success');
235+
});
238236

239-
Parse.Cloud.run('testFunction', {username:'hawk',password:'123456'})
240-
.then(() => logController.getLogs({ from: Date.now() - 500, size: 1000 }))
241-
.then((res) => {
242-
const entry = res[0];
243-
expect(entry.params.password).toMatch(/\*\*\*\*\*\*\*\*/);
244-
done();
245-
})
246-
.then(null, e => done.fail(e));
237+
Parse.Cloud.run('testFunction', {username:'hawk',password:'123456'})
238+
.then(() => logController.getLogs({ from: Date.now() - 500, size: 1000 }))
239+
.then((res) => {
240+
const entry = res[0];
241+
expect(entry.params.password).toMatch(/\*\*\*\*\*\*\*\*/);
242+
done();
243+
})
244+
.then(null, e => done.fail(e));
245+
});
247246
});

0 commit comments

Comments
 (0)