Skip to content

Commit ab11ef1

Browse files
committed
Merge pull request #826 from ParsePlatform/nlutsenko.schema
Convert Schema.js to ES6 class.
2 parents 438e802 + 295d361 commit ab11ef1

File tree

2 files changed

+399
-400
lines changed

2 files changed

+399
-400
lines changed

spec/Schema.spec.js

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -180,20 +180,18 @@ describe('Schema', () => {
180180

181181
it('will fail to create a class if that class was already created by an object', done => {
182182
config.database.loadSchema()
183-
.then(schema => {
184-
schema.validateObject('NewClass', {foo: 7})
185-
.then(() => {
186-
schema.reload()
187-
.then(schema => schema.addClassIfNotExists('NewClass', {
188-
foo: {type: 'String'}
189-
}))
190-
.catch(error => {
191-
expect(error.code).toEqual(Parse.Error.INVALID_CLASS_NAME);
192-
expect(error.message).toEqual('Class NewClass already exists.');
193-
done();
194-
});
183+
.then(schema => {
184+
schema.validateObject('NewClass', { foo: 7 })
185+
.then(() => schema.reloadData())
186+
.then(() => schema.addClassIfNotExists('NewClass', {
187+
foo: { type: 'String' }
188+
}))
189+
.catch(error => {
190+
expect(error.code).toEqual(Parse.Error.INVALID_CLASS_NAME);
191+
expect(error.message).toEqual('Class NewClass already exists.');
192+
done();
193+
});
195194
});
196-
})
197195
});
198196

199197
it('will resolve class creation races appropriately', done => {

0 commit comments

Comments
 (0)