Skip to content

Commit e5c9786

Browse files
committed
generalized test config; added test case for retrieving config afer saving
1 parent 8b2afad commit e5c9786

File tree

1 file changed

+14
-15
lines changed

1 file changed

+14
-15
lines changed

integration/test/ParseConfigTest.js

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ const Parse = require('../../node');
66

77
function testConfig() {
88
return Parse.Config.save(
9-
{ internal: "i", public: "p" },
9+
{ internal: "i", string: "s", number: 12 },
1010
{ internal: true }
1111
);
1212
}
@@ -22,37 +22,36 @@ describe('Parse Config', () => {
2222
});
2323

2424
it('can create a config', async () => {
25-
const config = await Parse.Config.save({
26-
str: 'hello',
27-
num: 42
28-
});
29-
assert.equal(config.get('str'), 'hello');
30-
assert.equal(config.get('num'), 42);
25+
const config = await testConfig();
26+
27+
assert.notStrictEqual(config, undefined);
28+
assert.strictEqual(config.get('string'), 's');
29+
assert.strictEqual(config.get('internal'), 'i');
30+
assert.strictEqual(config.get('number'), 12);
3131
});
3232

3333
it('can get a config', async () => {
34-
await Parse.Config.save({
35-
str: 'hello',
36-
num: 42
37-
});
34+
await testConfig();
35+
3836
const config = await Parse.Config.get();
39-
assert.equal(config.get('str'), 'hello');
40-
assert.equal(config.get('num'), 42);
37+
assert.notStrictEqual(config, undefined);
38+
assert.strictEqual(config.get('string'), 's');
39+
assert.strictEqual(config.get('number'), 12);
4140
});
4241

4342
it('can get internal config parameter with masterkey', async () => {
4443
await testConfig();
4544

4645
const config = await Parse.Config.get({ useMasterKey: true });
4746
assert.equal(config.get('internal'), 'i');
48-
assert.equal(config.get('public'), 'p');
47+
assert.equal(config.get('string'), 's');
4948
});
5049

5150
it('cannot get internal config parameter without masterkey', async () => {
5251
await testConfig();
5352

5453
const config = await Parse.Config.get();
5554
assert.equal(config.get('internal'), undefined);
56-
assert.equal(config.get('public'), 'p');
55+
assert.equal(config.get('string'), 's');
5756
});
5857
});

0 commit comments

Comments
 (0)