From 3e06a9de547b52c634eeb917b52375dd42999ed6 Mon Sep 17 00:00:00 2001 From: Christof Marti Date: Mon, 28 May 2018 11:22:56 +0200 Subject: [PATCH] Fix getmac test (#48804) --- src/vs/base/test/node/id.test.ts | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/vs/base/test/node/id.test.ts b/src/vs/base/test/node/id.test.ts index 0cddcf542492d..85a58de60ffa7 100644 --- a/src/vs/base/test/node/id.test.ts +++ b/src/vs/base/test/node/id.test.ts @@ -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((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