提交 3e06a9de 编写于 作者: C Christof Marti

Fix getmac test (#48804)

上级 8a1f33d2
......@@ -5,13 +5,22 @@
'use strict';
import * as assert from 'assert';
import * as getmac from 'getmac';
import { getMachineId } from 'vs/base/node/id';
suite('ID', () => {
test('getMachineId', function () {
return getMachineId().then(id => {
assert.ok(/^([0-9A-Fa-f]{2}[:-]){5}([0-9A-Fa-f]{2})$/.test(id), `Expected a MAC address: ${id}`);
assert.ok(id);
});
});
test('getMac', function () {
return new Promise<string>((resolve, reject) => {
getmac.getMac((err, macAddress) => err ? reject(err) : resolve(macAddress));
}).then(macAddress => {
assert.ok(/^([0-9A-Fa-f]{2}[:-]){5}([0-9A-Fa-f]{2})$/.test(macAddress), `Expected a MAC address, got: ${macAddress}`);
});
});
});
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册