mirror of
https://github.com/balena-os/balena-supervisor.git
synced 2024-12-20 06:07:57 +00:00
Merge pull request #1223 from balena-io/await-tests
Tests: Add missing await
This commit is contained in:
commit
2a8b75391d
@ -288,27 +288,25 @@ describe('deviceState', () => {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
it('stores info for pinning a device after loading an apps.json with a pinDevice field', () => {
|
it('stores info for pinning a device after loading an apps.json with a pinDevice field', async () => {
|
||||||
stub(deviceState.applications.images, 'save').returns(Promise.resolve());
|
stub(deviceState.applications.images, 'save').returns(Promise.resolve());
|
||||||
stub(deviceState.deviceConfig, 'getCurrent').returns(
|
stub(deviceState.deviceConfig, 'getCurrent').returns(
|
||||||
Promise.resolve(mockedInitialConfig),
|
Promise.resolve(mockedInitialConfig),
|
||||||
);
|
);
|
||||||
loadTargetFromFile(
|
await loadTargetFromFile(
|
||||||
process.env.ROOT_MOUNTPOINT + '/apps-pin.json',
|
process.env.ROOT_MOUNTPOINT + '/apps-pin.json',
|
||||||
deviceState,
|
deviceState,
|
||||||
).then(() => {
|
);
|
||||||
(deviceState as any).applications.images.save.restore();
|
(deviceState as any).applications.images.save.restore();
|
||||||
(deviceState as any).deviceConfig.getCurrent.restore();
|
(deviceState as any).deviceConfig.getCurrent.restore();
|
||||||
|
|
||||||
config.get('pinDevice').then(pinned => {
|
const pinned = await config.get('pinDevice');
|
||||||
expect(pinned)
|
expect(pinned)
|
||||||
.to.have.property('app')
|
.to.have.property('app')
|
||||||
.that.equals(1234);
|
.that.equals(1234);
|
||||||
expect(pinned)
|
expect(pinned)
|
||||||
.to.have.property('commit')
|
.to.have.property('commit')
|
||||||
.that.equals('abcdef');
|
.that.equals('abcdef');
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('emits a change event when a new state is reported', () => {
|
it('emits a change event when a new state is reported', () => {
|
||||||
|
Loading…
Reference in New Issue
Block a user