settings: async'ify

* directory config
* unstable app config
This commit is contained in:
Girish Ramakrishnan
2021-08-18 15:40:28 -07:00
parent 2d1f4ff281
commit 200018a022
6 changed files with 64 additions and 100 deletions

View File

@@ -84,24 +84,16 @@ describe('Settings', function () {
});
});
it('can get default unstable apps setting', function (done) {
settings.getUnstableAppsConfig(function (error, enabled) {
expect(error).to.be(null);
expect(enabled).to.be(true);
done();
});
it('can get default unstable apps setting', async function () {
const enabled = await settings.getUnstableAppsConfig();
expect(enabled).to.be(true);
});
it('can set unstable apps setting', function (done) {
settings.setUnstableAppsConfig(false, function (error) {
expect(error).to.be(null);
it('can set unstable apps setting', async function () {
await settings.setUnstableAppsConfig(false);
settings.getUnstableAppsConfig(function (error, enabled) {
expect(error).to.be(null);
expect(enabled).to.be(false);
done();
});
});
const enabled = await settings.getUnstableAppsConfig();
expect(enabled).to.be(false);
});
it('can get all values', async function () {