Skip to content

Commit

Permalink
fixed more failing tests.. almost there.
Browse files Browse the repository at this point in the history
  • Loading branch information
swittk committed Nov 1, 2023
1 parent b7a6b27 commit 4273ade
Show file tree
Hide file tree
Showing 8 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/CoreManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ type CloudController = {
startJob: (name: string, data: any, options: RequestOptions) => Promise<string>,
};
type ConfigController = {
current: () => Promise<ParseConfig>,
current: () => Promise<ParseConfig> | ParseConfig,
get: (opts?: RequestOptions) => Promise<ParseConfig>,
save: (attrs: { [key: string]: any }, masterKeyOnlyFlags?: { [key: string]: any }) => Promise<void>,
};
Expand Down
2 changes: 1 addition & 1 deletion src/ParseConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ function decodePayload(data) {
}

const DefaultController = {
current: async ()=> {
current: ()=> {
if (currentConfig) {
return currentConfig;
}
Expand Down
4 changes: 2 additions & 2 deletions src/ParseQuery.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2135,8 +2135,8 @@ class ParseQuery {
this._xhrRequest.onchange = () => { };
return this;
}
// TODO: Typescript.. How does this work? Does this even make sense?
return (this._xhrRequest.onchange = () => this.cancel());
this._xhrRequest.onchange = () => this.cancel();
return this;
}

_setRequestTask(options) {
Expand Down
3 changes: 1 addition & 2 deletions src/ParseSchema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -227,8 +227,7 @@ class ParseSchema {
return this.addPointer(name, options.targetClass!, options);
}
if (type === 'Relation') {
// TODO: Why does options exist here?
return this.addRelation(name, options.targetClass, options);
return this.addRelation(name, options.targetClass);
}
const fieldOptions: Partial<FieldOptions> & {
type: ValidFieldType,
Expand Down
2 changes: 1 addition & 1 deletion src/RESTController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -348,4 +348,4 @@ const RESTController = {
};

module.exports = RESTController;
export default RESTController;
export default RESTController;
1 change: 1 addition & 0 deletions src/__tests__/Hooks-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ jest.dontMock('../CoreManager');
jest.dontMock('../decode');
jest.dontMock('../encode');
jest.dontMock('../ParseError');
jest.dontMock('../ParseObject');

const Hooks = require('../ParseHooks');
const CoreManager = require('../CoreManager');
Expand Down
1 change: 1 addition & 0 deletions src/__tests__/ParseConfig-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ jest.dontMock('../RESTController');
jest.dontMock('../Storage');
jest.dontMock('../StorageController.default');
jest.dontMock('./test_helpers/mockAsyncStorage');
jest.dontMock('../ParseObject');

const mockAsyncStorage = require('./test_helpers/mockAsyncStorage');
const CoreManager = require('../CoreManager');
Expand Down
2 changes: 1 addition & 1 deletion src/decode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export default function decode(value: any): any {
}
if (value.__type === 'Relation') {
// The parent and key fields will be populated by the parent
const relation = new ParseRelation(undefined, undefined);
const relation = new ParseRelation(null, null); // null, null; since tests expect this.
relation.targetClassName = value.className;
return relation;
}
Expand Down

0 comments on commit 4273ade

Please sign in to comment.