@lynn123411/dsh-kimi-cu 0.3.7 → 0.3.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -183,8 +183,12 @@ await test('run:已是最新时不执行 upgrade', async () => {
183
183
 
184
184
  await test('run:有新版时先报阶段再执行,版本变了才重连', async () => {
185
185
  let version = '0.7.5';
186
+ const refreshes = [];
186
187
  const { updater, calls } = harness({
187
- current: async () => ({ path: '/Applications/KimiCU.app/Contents/MacOS/kimi-cu', version }),
188
+ current: async (refresh) => {
189
+ refreshes.push(refresh);
190
+ return { path: '/Applications/KimiCU.app/Contents/MacOS/kimi-cu', version };
191
+ },
188
192
  runUpgrade: async (input) => {
189
193
  calls.upgrade.push({ version: input.version });
190
194
  input.onLine('==> 校验代码签名与 Apple 公证 …');
@@ -199,6 +203,7 @@ await test('run:有新版时先报阶段再执行,版本变了才重连', as
199
203
  assert.equal(done.type, 'done');
200
204
  assert.equal(done.version, '0.7.6');
201
205
  assert.equal(done.reconnect, 'done');
206
+ assert.deepEqual(refreshes, [true, 'after-upgrade']);
202
207
  assert.equal(calls.reconnect, 1);
203
208
  assert.equal(calls.upgrade[0].version, null, 'macOS 不带版本号,让 KimiCU 自己判断');
204
209
  });