Switch to deepStrictEqual part of #118667

This commit is contained in:
Logan Ramos 2021-03-30 12:05:06 -04:00
parent 48cc8a84fd
commit d5a670eaeb
No known key found for this signature in database
GPG key ID: D9CCFF14F0B18183
88 changed files with 1971 additions and 1971 deletions

View file

@ -23,8 +23,8 @@ suite('XLF Parser Tests', () => {
}); });
test('XLF to keys & messages conversion', () => { test('XLF to keys & messages conversion', () => {
i18n.XLF.parse(sampleTranslatedXlf).then(function(resolvedFiles) { i18n.XLF.parse(sampleTranslatedXlf).then(function (resolvedFiles) {
assert.deepEqual(resolvedFiles[0].messages, translatedMessages); assert.deepStrictEqual(resolvedFiles[0].messages, translatedMessages);
assert.strictEqual(resolvedFiles[0].originalFilePath, originalFilePath); assert.strictEqual(resolvedFiles[0].originalFilePath, originalFilePath);
}); });
}); });
@ -40,15 +40,15 @@ suite('XLF Parser Tests', () => {
code = { name: 'vs/code', project: workbenchProject }, code = { name: 'vs/code', project: workbenchProject },
workbenchParts = { name: 'vs/workbench/contrib/html', project: workbenchProject }, workbenchParts = { name: 'vs/workbench/contrib/html', project: workbenchProject },
workbenchServices = { name: 'vs/workbench/services/textfile', project: workbenchProject }, workbenchServices = { name: 'vs/workbench/services/textfile', project: workbenchProject },
workbench = { name: 'vs/workbench', project: workbenchProject}; workbench = { name: 'vs/workbench', project: workbenchProject };
assert.deepEqual(i18n.getResource('vs/platform/actions/browser/menusExtensionPoint'), platform); assert.deepStrictEqual(i18n.getResource('vs/platform/actions/browser/menusExtensionPoint'), platform);
assert.deepEqual(i18n.getResource('vs/editor/contrib/clipboard/browser/clipboard'), editorContrib); assert.deepStrictEqual(i18n.getResource('vs/editor/contrib/clipboard/browser/clipboard'), editorContrib);
assert.deepEqual(i18n.getResource('vs/editor/common/modes/modesRegistry'), editor); assert.deepStrictEqual(i18n.getResource('vs/editor/common/modes/modesRegistry'), editor);
assert.deepEqual(i18n.getResource('vs/base/common/errorMessage'), base); assert.deepStrictEqual(i18n.getResource('vs/base/common/errorMessage'), base);
assert.deepEqual(i18n.getResource('vs/code/electron-main/window'), code); assert.deepStrictEqual(i18n.getResource('vs/code/electron-main/window'), code);
assert.deepEqual(i18n.getResource('vs/workbench/contrib/html/browser/webview'), workbenchParts); assert.deepStrictEqual(i18n.getResource('vs/workbench/contrib/html/browser/webview'), workbenchParts);
assert.deepEqual(i18n.getResource('vs/workbench/services/textfile/node/testFileService'), workbenchServices); assert.deepStrictEqual(i18n.getResource('vs/workbench/services/textfile/node/testFileService'), workbenchServices);
assert.deepEqual(i18n.getResource('vs/workbench/browser/parts/panel/panelActions'), workbench); assert.deepStrictEqual(i18n.getResource('vs/workbench/browser/parts/panel/panelActions'), workbench);
}); });
}); });

View file

@ -304,15 +304,15 @@ suite('Base IPC', function () {
ipcService.onPong(msg => messages.push(msg)); ipcService.onPong(msg => messages.push(msg));
await timeout(0); await timeout(0);
assert.deepEqual(messages, []); assert.deepStrictEqual(messages, []);
service.ping('hello'); service.ping('hello');
await timeout(0); await timeout(0);
assert.deepEqual(messages, ['hello']); assert.deepStrictEqual(messages, ['hello']);
service.ping('world'); service.ping('world');
await timeout(0); await timeout(0);
assert.deepEqual(messages, ['hello', 'world']); assert.deepStrictEqual(messages, ['hello', 'world']);
}); });
test('buffers in arrays', async function () { test('buffers in arrays', async function () {
@ -363,15 +363,15 @@ suite('Base IPC', function () {
ipcService.onPong(msg => messages.push(msg)); ipcService.onPong(msg => messages.push(msg));
await timeout(0); await timeout(0);
assert.deepEqual(messages, []); assert.deepStrictEqual(messages, []);
service.ping('hello'); service.ping('hello');
await timeout(0); await timeout(0);
assert.deepEqual(messages, ['hello']); assert.deepStrictEqual(messages, ['hello']);
service.ping('world'); service.ping('world');
await timeout(0); await timeout(0);
assert.deepEqual(messages, ['hello', 'world']); assert.deepStrictEqual(messages, ['hello', 'world']);
}); });
test('marshalling uri', async function () { test('marshalling uri', async function () {
@ -461,7 +461,7 @@ suite('Base IPC', function () {
clientService1.ping('hello 1'); clientService1.ping('hello 1');
await timeout(1); await timeout(1);
assert.deepEqual(pings, ['hello 1']); assert.deepStrictEqual(pings, ['hello 1']);
const client2 = server.createConnection('client2'); const client2 = server.createConnection('client2');
const clientService2 = new TestService(); const clientService2 = new TestService();
@ -472,19 +472,19 @@ suite('Base IPC', function () {
clientService2.ping('hello 2'); clientService2.ping('hello 2');
await timeout(1); await timeout(1);
assert.deepEqual(pings, ['hello 1', 'hello 2']); assert.deepStrictEqual(pings, ['hello 1', 'hello 2']);
client1.dispose(); client1.dispose();
clientService1.ping('hello 1'); clientService1.ping('hello 1');
await timeout(1); await timeout(1);
assert.deepEqual(pings, ['hello 1', 'hello 2']); assert.deepStrictEqual(pings, ['hello 1', 'hello 2']);
await timeout(1); await timeout(1);
clientService2.ping('hello again 2'); clientService2.ping('hello again 2');
await timeout(1); await timeout(1);
assert.deepEqual(pings, ['hello 1', 'hello 2', 'hello again 2']); assert.deepStrictEqual(pings, ['hello 1', 'hello 2', 'hello again 2']);
client2.dispose(); client2.dispose();
server.dispose(); server.dispose();

View file

@ -40,35 +40,35 @@ suite('Grid', function () {
}); });
test('getRelativeLocation', () => { test('getRelativeLocation', () => {
assert.deepEqual(getRelativeLocation(Orientation.VERTICAL, [0], Direction.Up), [0]); assert.deepStrictEqual(getRelativeLocation(Orientation.VERTICAL, [0], Direction.Up), [0]);
assert.deepEqual(getRelativeLocation(Orientation.VERTICAL, [0], Direction.Down), [1]); assert.deepStrictEqual(getRelativeLocation(Orientation.VERTICAL, [0], Direction.Down), [1]);
assert.deepEqual(getRelativeLocation(Orientation.VERTICAL, [0], Direction.Left), [0, 0]); assert.deepStrictEqual(getRelativeLocation(Orientation.VERTICAL, [0], Direction.Left), [0, 0]);
assert.deepEqual(getRelativeLocation(Orientation.VERTICAL, [0], Direction.Right), [0, 1]); assert.deepStrictEqual(getRelativeLocation(Orientation.VERTICAL, [0], Direction.Right), [0, 1]);
assert.deepEqual(getRelativeLocation(Orientation.HORIZONTAL, [0], Direction.Up), [0, 0]); assert.deepStrictEqual(getRelativeLocation(Orientation.HORIZONTAL, [0], Direction.Up), [0, 0]);
assert.deepEqual(getRelativeLocation(Orientation.HORIZONTAL, [0], Direction.Down), [0, 1]); assert.deepStrictEqual(getRelativeLocation(Orientation.HORIZONTAL, [0], Direction.Down), [0, 1]);
assert.deepEqual(getRelativeLocation(Orientation.HORIZONTAL, [0], Direction.Left), [0]); assert.deepStrictEqual(getRelativeLocation(Orientation.HORIZONTAL, [0], Direction.Left), [0]);
assert.deepEqual(getRelativeLocation(Orientation.HORIZONTAL, [0], Direction.Right), [1]); assert.deepStrictEqual(getRelativeLocation(Orientation.HORIZONTAL, [0], Direction.Right), [1]);
assert.deepEqual(getRelativeLocation(Orientation.VERTICAL, [4], Direction.Up), [4]); assert.deepStrictEqual(getRelativeLocation(Orientation.VERTICAL, [4], Direction.Up), [4]);
assert.deepEqual(getRelativeLocation(Orientation.VERTICAL, [4], Direction.Down), [5]); assert.deepStrictEqual(getRelativeLocation(Orientation.VERTICAL, [4], Direction.Down), [5]);
assert.deepEqual(getRelativeLocation(Orientation.VERTICAL, [4], Direction.Left), [4, 0]); assert.deepStrictEqual(getRelativeLocation(Orientation.VERTICAL, [4], Direction.Left), [4, 0]);
assert.deepEqual(getRelativeLocation(Orientation.VERTICAL, [4], Direction.Right), [4, 1]); assert.deepStrictEqual(getRelativeLocation(Orientation.VERTICAL, [4], Direction.Right), [4, 1]);
assert.deepEqual(getRelativeLocation(Orientation.VERTICAL, [0, 0], Direction.Up), [0, 0, 0]); assert.deepStrictEqual(getRelativeLocation(Orientation.VERTICAL, [0, 0], Direction.Up), [0, 0, 0]);
assert.deepEqual(getRelativeLocation(Orientation.VERTICAL, [0, 0], Direction.Down), [0, 0, 1]); assert.deepStrictEqual(getRelativeLocation(Orientation.VERTICAL, [0, 0], Direction.Down), [0, 0, 1]);
assert.deepEqual(getRelativeLocation(Orientation.VERTICAL, [0, 0], Direction.Left), [0, 0]); assert.deepStrictEqual(getRelativeLocation(Orientation.VERTICAL, [0, 0], Direction.Left), [0, 0]);
assert.deepEqual(getRelativeLocation(Orientation.VERTICAL, [0, 0], Direction.Right), [0, 1]); assert.deepStrictEqual(getRelativeLocation(Orientation.VERTICAL, [0, 0], Direction.Right), [0, 1]);
assert.deepEqual(getRelativeLocation(Orientation.VERTICAL, [1, 2], Direction.Up), [1, 2, 0]); assert.deepStrictEqual(getRelativeLocation(Orientation.VERTICAL, [1, 2], Direction.Up), [1, 2, 0]);
assert.deepEqual(getRelativeLocation(Orientation.VERTICAL, [1, 2], Direction.Down), [1, 2, 1]); assert.deepStrictEqual(getRelativeLocation(Orientation.VERTICAL, [1, 2], Direction.Down), [1, 2, 1]);
assert.deepEqual(getRelativeLocation(Orientation.VERTICAL, [1, 2], Direction.Left), [1, 2]); assert.deepStrictEqual(getRelativeLocation(Orientation.VERTICAL, [1, 2], Direction.Left), [1, 2]);
assert.deepEqual(getRelativeLocation(Orientation.VERTICAL, [1, 2], Direction.Right), [1, 3]); assert.deepStrictEqual(getRelativeLocation(Orientation.VERTICAL, [1, 2], Direction.Right), [1, 3]);
assert.deepEqual(getRelativeLocation(Orientation.VERTICAL, [1, 2, 3], Direction.Up), [1, 2, 3]); assert.deepStrictEqual(getRelativeLocation(Orientation.VERTICAL, [1, 2, 3], Direction.Up), [1, 2, 3]);
assert.deepEqual(getRelativeLocation(Orientation.VERTICAL, [1, 2, 3], Direction.Down), [1, 2, 4]); assert.deepStrictEqual(getRelativeLocation(Orientation.VERTICAL, [1, 2, 3], Direction.Down), [1, 2, 4]);
assert.deepEqual(getRelativeLocation(Orientation.VERTICAL, [1, 2, 3], Direction.Left), [1, 2, 3, 0]); assert.deepStrictEqual(getRelativeLocation(Orientation.VERTICAL, [1, 2, 3], Direction.Left), [1, 2, 3, 0]);
assert.deepEqual(getRelativeLocation(Orientation.VERTICAL, [1, 2, 3], Direction.Right), [1, 2, 3, 1]); assert.deepStrictEqual(getRelativeLocation(Orientation.VERTICAL, [1, 2, 3], Direction.Right), [1, 2, 3, 1]);
}); });
test('empty', () => { test('empty', () => {
@ -77,7 +77,7 @@ suite('Grid', function () {
container.appendChild(gridview.element); container.appendChild(gridview.element);
gridview.layout(800, 600); gridview.layout(800, 600);
assert.deepEqual(view1.size, [800, 600]); assert.deepStrictEqual(view1.size, [800, 600]);
}); });
test('two views vertically', function () { test('two views vertically', function () {
@ -85,12 +85,12 @@ suite('Grid', function () {
const grid = new Grid(view1); const grid = new Grid(view1);
container.appendChild(grid.element); container.appendChild(grid.element);
grid.layout(800, 600); grid.layout(800, 600);
assert.deepEqual(view1.size, [800, 600]); assert.deepStrictEqual(view1.size, [800, 600]);
const view2 = new TestView(50, Number.MAX_VALUE, 50, Number.MAX_VALUE); const view2 = new TestView(50, Number.MAX_VALUE, 50, Number.MAX_VALUE);
grid.addView(view2, 200, view1, Direction.Up); grid.addView(view2, 200, view1, Direction.Up);
assert.deepEqual(view1.size, [800, 400]); assert.deepStrictEqual(view1.size, [800, 400]);
assert.deepEqual(view2.size, [800, 200]); assert.deepStrictEqual(view2.size, [800, 200]);
}); });
test('two views horizontally', function () { test('two views horizontally', function () {
@ -99,12 +99,12 @@ suite('Grid', function () {
container.appendChild(grid.element); container.appendChild(grid.element);
grid.layout(800, 600); grid.layout(800, 600);
assert.deepEqual(view1.size, [800, 600]); assert.deepStrictEqual(view1.size, [800, 600]);
const view2 = new TestView(50, Number.MAX_VALUE, 50, Number.MAX_VALUE); const view2 = new TestView(50, Number.MAX_VALUE, 50, Number.MAX_VALUE);
grid.addView(view2, 300, view1, Direction.Right); grid.addView(view2, 300, view1, Direction.Right);
assert.deepEqual(view1.size, [500, 600]); assert.deepStrictEqual(view1.size, [500, 600]);
assert.deepEqual(view2.size, [300, 600]); assert.deepStrictEqual(view2.size, [300, 600]);
}); });
test('simple layout', function () { test('simple layout', function () {
@ -113,33 +113,33 @@ suite('Grid', function () {
container.appendChild(grid.element); container.appendChild(grid.element);
grid.layout(800, 600); grid.layout(800, 600);
assert.deepEqual(view1.size, [800, 600]); assert.deepStrictEqual(view1.size, [800, 600]);
const view2 = new TestView(50, Number.MAX_VALUE, 50, Number.MAX_VALUE); const view2 = new TestView(50, Number.MAX_VALUE, 50, Number.MAX_VALUE);
grid.addView(view2, 200, view1, Direction.Up); grid.addView(view2, 200, view1, Direction.Up);
assert.deepEqual(view1.size, [800, 400]); assert.deepStrictEqual(view1.size, [800, 400]);
assert.deepEqual(view2.size, [800, 200]); assert.deepStrictEqual(view2.size, [800, 200]);
const view3 = new TestView(50, Number.MAX_VALUE, 50, Number.MAX_VALUE); const view3 = new TestView(50, Number.MAX_VALUE, 50, Number.MAX_VALUE);
grid.addView(view3, 200, view1, Direction.Right); grid.addView(view3, 200, view1, Direction.Right);
assert.deepEqual(view1.size, [600, 400]); assert.deepStrictEqual(view1.size, [600, 400]);
assert.deepEqual(view2.size, [800, 200]); assert.deepStrictEqual(view2.size, [800, 200]);
assert.deepEqual(view3.size, [200, 400]); assert.deepStrictEqual(view3.size, [200, 400]);
const view4 = new TestView(50, Number.MAX_VALUE, 50, Number.MAX_VALUE); const view4 = new TestView(50, Number.MAX_VALUE, 50, Number.MAX_VALUE);
grid.addView(view4, 200, view2, Direction.Left); grid.addView(view4, 200, view2, Direction.Left);
assert.deepEqual(view1.size, [600, 400]); assert.deepStrictEqual(view1.size, [600, 400]);
assert.deepEqual(view2.size, [600, 200]); assert.deepStrictEqual(view2.size, [600, 200]);
assert.deepEqual(view3.size, [200, 400]); assert.deepStrictEqual(view3.size, [200, 400]);
assert.deepEqual(view4.size, [200, 200]); assert.deepStrictEqual(view4.size, [200, 200]);
const view5 = new TestView(50, Number.MAX_VALUE, 50, Number.MAX_VALUE); const view5 = new TestView(50, Number.MAX_VALUE, 50, Number.MAX_VALUE);
grid.addView(view5, 100, view1, Direction.Down); grid.addView(view5, 100, view1, Direction.Down);
assert.deepEqual(view1.size, [600, 300]); assert.deepStrictEqual(view1.size, [600, 300]);
assert.deepEqual(view2.size, [600, 200]); assert.deepStrictEqual(view2.size, [600, 200]);
assert.deepEqual(view3.size, [200, 400]); assert.deepStrictEqual(view3.size, [200, 400]);
assert.deepEqual(view4.size, [200, 200]); assert.deepStrictEqual(view4.size, [200, 200]);
assert.deepEqual(view5.size, [600, 100]); assert.deepStrictEqual(view5.size, [600, 100]);
}); });
test('another simple layout with automatic size distribution', function () { test('another simple layout with automatic size distribution', function () {
@ -148,42 +148,42 @@ suite('Grid', function () {
container.appendChild(grid.element); container.appendChild(grid.element);
grid.layout(800, 600); grid.layout(800, 600);
assert.deepEqual(view1.size, [800, 600]); assert.deepStrictEqual(view1.size, [800, 600]);
const view2 = new TestView(50, Number.MAX_VALUE, 50, Number.MAX_VALUE); const view2 = new TestView(50, Number.MAX_VALUE, 50, Number.MAX_VALUE);
grid.addView(view2, Sizing.Distribute, view1, Direction.Left); grid.addView(view2, Sizing.Distribute, view1, Direction.Left);
assert.deepEqual(view1.size, [400, 600]); assert.deepStrictEqual(view1.size, [400, 600]);
assert.deepEqual(view2.size, [400, 600]); assert.deepStrictEqual(view2.size, [400, 600]);
const view3 = new TestView(50, Number.MAX_VALUE, 50, Number.MAX_VALUE); const view3 = new TestView(50, Number.MAX_VALUE, 50, Number.MAX_VALUE);
grid.addView(view3, Sizing.Distribute, view1, Direction.Right); grid.addView(view3, Sizing.Distribute, view1, Direction.Right);
assert.deepEqual(view1.size, [266, 600]); assert.deepStrictEqual(view1.size, [266, 600]);
assert.deepEqual(view2.size, [266, 600]); assert.deepStrictEqual(view2.size, [266, 600]);
assert.deepEqual(view3.size, [268, 600]); assert.deepStrictEqual(view3.size, [268, 600]);
const view4 = new TestView(50, Number.MAX_VALUE, 50, Number.MAX_VALUE); const view4 = new TestView(50, Number.MAX_VALUE, 50, Number.MAX_VALUE);
grid.addView(view4, Sizing.Distribute, view2, Direction.Down); grid.addView(view4, Sizing.Distribute, view2, Direction.Down);
assert.deepEqual(view1.size, [266, 600]); assert.deepStrictEqual(view1.size, [266, 600]);
assert.deepEqual(view2.size, [266, 300]); assert.deepStrictEqual(view2.size, [266, 300]);
assert.deepEqual(view3.size, [268, 600]); assert.deepStrictEqual(view3.size, [268, 600]);
assert.deepEqual(view4.size, [266, 300]); assert.deepStrictEqual(view4.size, [266, 300]);
const view5 = new TestView(50, Number.MAX_VALUE, 50, Number.MAX_VALUE); const view5 = new TestView(50, Number.MAX_VALUE, 50, Number.MAX_VALUE);
grid.addView(view5, Sizing.Distribute, view3, Direction.Up); grid.addView(view5, Sizing.Distribute, view3, Direction.Up);
assert.deepEqual(view1.size, [266, 600]); assert.deepStrictEqual(view1.size, [266, 600]);
assert.deepEqual(view2.size, [266, 300]); assert.deepStrictEqual(view2.size, [266, 300]);
assert.deepEqual(view3.size, [268, 300]); assert.deepStrictEqual(view3.size, [268, 300]);
assert.deepEqual(view4.size, [266, 300]); assert.deepStrictEqual(view4.size, [266, 300]);
assert.deepEqual(view5.size, [268, 300]); assert.deepStrictEqual(view5.size, [268, 300]);
const view6 = new TestView(50, Number.MAX_VALUE, 50, Number.MAX_VALUE); const view6 = new TestView(50, Number.MAX_VALUE, 50, Number.MAX_VALUE);
grid.addView(view6, Sizing.Distribute, view3, Direction.Down); grid.addView(view6, Sizing.Distribute, view3, Direction.Down);
assert.deepEqual(view1.size, [266, 600]); assert.deepStrictEqual(view1.size, [266, 600]);
assert.deepEqual(view2.size, [266, 300]); assert.deepStrictEqual(view2.size, [266, 300]);
assert.deepEqual(view3.size, [268, 200]); assert.deepStrictEqual(view3.size, [268, 200]);
assert.deepEqual(view4.size, [266, 300]); assert.deepStrictEqual(view4.size, [266, 300]);
assert.deepEqual(view5.size, [268, 200]); assert.deepStrictEqual(view5.size, [268, 200]);
assert.deepEqual(view6.size, [268, 200]); assert.deepStrictEqual(view6.size, [268, 200]);
}); });
test('another simple layout with split size distribution', function () { test('another simple layout with split size distribution', function () {
@ -192,42 +192,42 @@ suite('Grid', function () {
container.appendChild(grid.element); container.appendChild(grid.element);
grid.layout(800, 600); grid.layout(800, 600);
assert.deepEqual(view1.size, [800, 600]); assert.deepStrictEqual(view1.size, [800, 600]);
const view2 = new TestView(50, Number.MAX_VALUE, 50, Number.MAX_VALUE); const view2 = new TestView(50, Number.MAX_VALUE, 50, Number.MAX_VALUE);
grid.addView(view2, Sizing.Split, view1, Direction.Left); grid.addView(view2, Sizing.Split, view1, Direction.Left);
assert.deepEqual(view1.size, [400, 600]); assert.deepStrictEqual(view1.size, [400, 600]);
assert.deepEqual(view2.size, [400, 600]); assert.deepStrictEqual(view2.size, [400, 600]);
const view3 = new TestView(50, Number.MAX_VALUE, 50, Number.MAX_VALUE); const view3 = new TestView(50, Number.MAX_VALUE, 50, Number.MAX_VALUE);
grid.addView(view3, Sizing.Split, view1, Direction.Right); grid.addView(view3, Sizing.Split, view1, Direction.Right);
assert.deepEqual(view1.size, [200, 600]); assert.deepStrictEqual(view1.size, [200, 600]);
assert.deepEqual(view2.size, [400, 600]); assert.deepStrictEqual(view2.size, [400, 600]);
assert.deepEqual(view3.size, [200, 600]); assert.deepStrictEqual(view3.size, [200, 600]);
const view4 = new TestView(50, Number.MAX_VALUE, 50, Number.MAX_VALUE); const view4 = new TestView(50, Number.MAX_VALUE, 50, Number.MAX_VALUE);
grid.addView(view4, Sizing.Split, view2, Direction.Down); grid.addView(view4, Sizing.Split, view2, Direction.Down);
assert.deepEqual(view1.size, [200, 600]); assert.deepStrictEqual(view1.size, [200, 600]);
assert.deepEqual(view2.size, [400, 300]); assert.deepStrictEqual(view2.size, [400, 300]);
assert.deepEqual(view3.size, [200, 600]); assert.deepStrictEqual(view3.size, [200, 600]);
assert.deepEqual(view4.size, [400, 300]); assert.deepStrictEqual(view4.size, [400, 300]);
const view5 = new TestView(50, Number.MAX_VALUE, 50, Number.MAX_VALUE); const view5 = new TestView(50, Number.MAX_VALUE, 50, Number.MAX_VALUE);
grid.addView(view5, Sizing.Split, view3, Direction.Up); grid.addView(view5, Sizing.Split, view3, Direction.Up);
assert.deepEqual(view1.size, [200, 600]); assert.deepStrictEqual(view1.size, [200, 600]);
assert.deepEqual(view2.size, [400, 300]); assert.deepStrictEqual(view2.size, [400, 300]);
assert.deepEqual(view3.size, [200, 300]); assert.deepStrictEqual(view3.size, [200, 300]);
assert.deepEqual(view4.size, [400, 300]); assert.deepStrictEqual(view4.size, [400, 300]);
assert.deepEqual(view5.size, [200, 300]); assert.deepStrictEqual(view5.size, [200, 300]);
const view6 = new TestView(50, Number.MAX_VALUE, 50, Number.MAX_VALUE); const view6 = new TestView(50, Number.MAX_VALUE, 50, Number.MAX_VALUE);
grid.addView(view6, Sizing.Split, view3, Direction.Down); grid.addView(view6, Sizing.Split, view3, Direction.Down);
assert.deepEqual(view1.size, [200, 600]); assert.deepStrictEqual(view1.size, [200, 600]);
assert.deepEqual(view2.size, [400, 300]); assert.deepStrictEqual(view2.size, [400, 300]);
assert.deepEqual(view3.size, [200, 150]); assert.deepStrictEqual(view3.size, [200, 150]);
assert.deepEqual(view4.size, [400, 300]); assert.deepStrictEqual(view4.size, [400, 300]);
assert.deepEqual(view5.size, [200, 300]); assert.deepStrictEqual(view5.size, [200, 300]);
assert.deepEqual(view6.size, [200, 150]); assert.deepStrictEqual(view6.size, [200, 150]);
}); });
test('3/2 layout with split', function () { test('3/2 layout with split', function () {
@ -236,33 +236,33 @@ suite('Grid', function () {
container.appendChild(grid.element); container.appendChild(grid.element);
grid.layout(800, 600); grid.layout(800, 600);
assert.deepEqual(view1.size, [800, 600]); assert.deepStrictEqual(view1.size, [800, 600]);
const view2 = new TestView(50, Number.MAX_VALUE, 50, Number.MAX_VALUE); const view2 = new TestView(50, Number.MAX_VALUE, 50, Number.MAX_VALUE);
grid.addView(view2, Sizing.Split, view1, Direction.Down); grid.addView(view2, Sizing.Split, view1, Direction.Down);
assert.deepEqual(view1.size, [800, 300]); assert.deepStrictEqual(view1.size, [800, 300]);
assert.deepEqual(view2.size, [800, 300]); assert.deepStrictEqual(view2.size, [800, 300]);
const view3 = new TestView(50, Number.MAX_VALUE, 50, Number.MAX_VALUE); const view3 = new TestView(50, Number.MAX_VALUE, 50, Number.MAX_VALUE);
grid.addView(view3, Sizing.Split, view2, Direction.Right); grid.addView(view3, Sizing.Split, view2, Direction.Right);
assert.deepEqual(view1.size, [800, 300]); assert.deepStrictEqual(view1.size, [800, 300]);
assert.deepEqual(view2.size, [400, 300]); assert.deepStrictEqual(view2.size, [400, 300]);
assert.deepEqual(view3.size, [400, 300]); assert.deepStrictEqual(view3.size, [400, 300]);
const view4 = new TestView(50, Number.MAX_VALUE, 50, Number.MAX_VALUE); const view4 = new TestView(50, Number.MAX_VALUE, 50, Number.MAX_VALUE);
grid.addView(view4, Sizing.Split, view1, Direction.Right); grid.addView(view4, Sizing.Split, view1, Direction.Right);
assert.deepEqual(view1.size, [400, 300]); assert.deepStrictEqual(view1.size, [400, 300]);
assert.deepEqual(view2.size, [400, 300]); assert.deepStrictEqual(view2.size, [400, 300]);
assert.deepEqual(view3.size, [400, 300]); assert.deepStrictEqual(view3.size, [400, 300]);
assert.deepEqual(view4.size, [400, 300]); assert.deepStrictEqual(view4.size, [400, 300]);
const view5 = new TestView(50, Number.MAX_VALUE, 50, Number.MAX_VALUE); const view5 = new TestView(50, Number.MAX_VALUE, 50, Number.MAX_VALUE);
grid.addView(view5, Sizing.Split, view1, Direction.Right); grid.addView(view5, Sizing.Split, view1, Direction.Right);
assert.deepEqual(view1.size, [200, 300]); assert.deepStrictEqual(view1.size, [200, 300]);
assert.deepEqual(view2.size, [400, 300]); assert.deepStrictEqual(view2.size, [400, 300]);
assert.deepEqual(view3.size, [400, 300]); assert.deepStrictEqual(view3.size, [400, 300]);
assert.deepEqual(view4.size, [400, 300]); assert.deepStrictEqual(view4.size, [400, 300]);
assert.deepEqual(view5.size, [200, 300]); assert.deepStrictEqual(view5.size, [200, 300]);
}); });
test('sizing should be correct after branch demotion #50564', function () { test('sizing should be correct after branch demotion #50564', function () {
@ -280,15 +280,15 @@ suite('Grid', function () {
const view4 = new TestView(50, Number.MAX_VALUE, 50, Number.MAX_VALUE); const view4 = new TestView(50, Number.MAX_VALUE, 50, Number.MAX_VALUE);
grid.addView(view4, Sizing.Split, view2, Direction.Right); grid.addView(view4, Sizing.Split, view2, Direction.Right);
assert.deepEqual(view1.size, [400, 600]); assert.deepStrictEqual(view1.size, [400, 600]);
assert.deepEqual(view2.size, [200, 300]); assert.deepStrictEqual(view2.size, [200, 300]);
assert.deepEqual(view3.size, [400, 300]); assert.deepStrictEqual(view3.size, [400, 300]);
assert.deepEqual(view4.size, [200, 300]); assert.deepStrictEqual(view4.size, [200, 300]);
grid.removeView(view3); grid.removeView(view3);
assert.deepEqual(view1.size, [400, 600]); assert.deepStrictEqual(view1.size, [400, 600]);
assert.deepEqual(view2.size, [200, 600]); assert.deepStrictEqual(view2.size, [200, 600]);
assert.deepEqual(view4.size, [200, 600]); assert.deepStrictEqual(view4.size, [200, 600]);
}); });
test('sizing should be correct after branch demotion #50675', function () { test('sizing should be correct after branch demotion #50675', function () {
@ -306,15 +306,15 @@ suite('Grid', function () {
const view4 = new TestView(50, Number.MAX_VALUE, 50, Number.MAX_VALUE); const view4 = new TestView(50, Number.MAX_VALUE, 50, Number.MAX_VALUE);
grid.addView(view4, Sizing.Distribute, view3, Direction.Right); grid.addView(view4, Sizing.Distribute, view3, Direction.Right);
assert.deepEqual(view1.size, [800, 200]); assert.deepStrictEqual(view1.size, [800, 200]);
assert.deepEqual(view2.size, [800, 200]); assert.deepStrictEqual(view2.size, [800, 200]);
assert.deepEqual(view3.size, [400, 200]); assert.deepStrictEqual(view3.size, [400, 200]);
assert.deepEqual(view4.size, [400, 200]); assert.deepStrictEqual(view4.size, [400, 200]);
grid.removeView(view3, Sizing.Distribute); grid.removeView(view3, Sizing.Distribute);
assert.deepEqual(view1.size, [800, 200]); assert.deepStrictEqual(view1.size, [800, 200]);
assert.deepEqual(view2.size, [800, 200]); assert.deepStrictEqual(view2.size, [800, 200]);
assert.deepEqual(view4.size, [800, 200]); assert.deepStrictEqual(view4.size, [800, 200]);
}); });
test('getNeighborViews should work on single view layout', function () { test('getNeighborViews should work on single view layout', function () {
@ -324,15 +324,15 @@ suite('Grid', function () {
grid.layout(800, 600); grid.layout(800, 600);
assert.deepEqual(grid.getNeighborViews(view1, Direction.Up), []); assert.deepStrictEqual(grid.getNeighborViews(view1, Direction.Up), []);
assert.deepEqual(grid.getNeighborViews(view1, Direction.Right), []); assert.deepStrictEqual(grid.getNeighborViews(view1, Direction.Right), []);
assert.deepEqual(grid.getNeighborViews(view1, Direction.Down), []); assert.deepStrictEqual(grid.getNeighborViews(view1, Direction.Down), []);
assert.deepEqual(grid.getNeighborViews(view1, Direction.Left), []); assert.deepStrictEqual(grid.getNeighborViews(view1, Direction.Left), []);
assert.deepEqual(grid.getNeighborViews(view1, Direction.Up, true), [view1]); assert.deepStrictEqual(grid.getNeighborViews(view1, Direction.Up, true), [view1]);
assert.deepEqual(grid.getNeighborViews(view1, Direction.Right, true), [view1]); assert.deepStrictEqual(grid.getNeighborViews(view1, Direction.Right, true), [view1]);
assert.deepEqual(grid.getNeighborViews(view1, Direction.Down, true), [view1]); assert.deepStrictEqual(grid.getNeighborViews(view1, Direction.Down, true), [view1]);
assert.deepEqual(grid.getNeighborViews(view1, Direction.Left, true), [view1]); assert.deepStrictEqual(grid.getNeighborViews(view1, Direction.Left, true), [view1]);
}); });
test('getNeighborViews should work on simple layout', function () { test('getNeighborViews should work on simple layout', function () {
@ -348,35 +348,35 @@ suite('Grid', function () {
const view3 = new TestView(50, Number.MAX_VALUE, 50, Number.MAX_VALUE); const view3 = new TestView(50, Number.MAX_VALUE, 50, Number.MAX_VALUE);
grid.addView(view3, Sizing.Distribute, view2, Direction.Down); grid.addView(view3, Sizing.Distribute, view2, Direction.Down);
assert.deepEqual(grid.getNeighborViews(view1, Direction.Up), []); assert.deepStrictEqual(grid.getNeighborViews(view1, Direction.Up), []);
assert.deepEqual(grid.getNeighborViews(view1, Direction.Right), []); assert.deepStrictEqual(grid.getNeighborViews(view1, Direction.Right), []);
assert.deepEqual(grid.getNeighborViews(view1, Direction.Down), [view2]); assert.deepStrictEqual(grid.getNeighborViews(view1, Direction.Down), [view2]);
assert.deepEqual(grid.getNeighborViews(view1, Direction.Left), []); assert.deepStrictEqual(grid.getNeighborViews(view1, Direction.Left), []);
assert.deepEqual(grid.getNeighborViews(view1, Direction.Up, true), [view3]); assert.deepStrictEqual(grid.getNeighborViews(view1, Direction.Up, true), [view3]);
assert.deepEqual(grid.getNeighborViews(view1, Direction.Right, true), [view1]); assert.deepStrictEqual(grid.getNeighborViews(view1, Direction.Right, true), [view1]);
assert.deepEqual(grid.getNeighborViews(view1, Direction.Down, true), [view2]); assert.deepStrictEqual(grid.getNeighborViews(view1, Direction.Down, true), [view2]);
assert.deepEqual(grid.getNeighborViews(view1, Direction.Left, true), [view1]); assert.deepStrictEqual(grid.getNeighborViews(view1, Direction.Left, true), [view1]);
assert.deepEqual(grid.getNeighborViews(view2, Direction.Up), [view1]); assert.deepStrictEqual(grid.getNeighborViews(view2, Direction.Up), [view1]);
assert.deepEqual(grid.getNeighborViews(view2, Direction.Right), []); assert.deepStrictEqual(grid.getNeighborViews(view2, Direction.Right), []);
assert.deepEqual(grid.getNeighborViews(view2, Direction.Down), [view3]); assert.deepStrictEqual(grid.getNeighborViews(view2, Direction.Down), [view3]);
assert.deepEqual(grid.getNeighborViews(view2, Direction.Left), []); assert.deepStrictEqual(grid.getNeighborViews(view2, Direction.Left), []);
assert.deepEqual(grid.getNeighborViews(view2, Direction.Up, true), [view1]); assert.deepStrictEqual(grid.getNeighborViews(view2, Direction.Up, true), [view1]);
assert.deepEqual(grid.getNeighborViews(view2, Direction.Right, true), [view2]); assert.deepStrictEqual(grid.getNeighborViews(view2, Direction.Right, true), [view2]);
assert.deepEqual(grid.getNeighborViews(view2, Direction.Down, true), [view3]); assert.deepStrictEqual(grid.getNeighborViews(view2, Direction.Down, true), [view3]);
assert.deepEqual(grid.getNeighborViews(view2, Direction.Left, true), [view2]); assert.deepStrictEqual(grid.getNeighborViews(view2, Direction.Left, true), [view2]);
assert.deepEqual(grid.getNeighborViews(view3, Direction.Up), [view2]); assert.deepStrictEqual(grid.getNeighborViews(view3, Direction.Up), [view2]);
assert.deepEqual(grid.getNeighborViews(view3, Direction.Right), []); assert.deepStrictEqual(grid.getNeighborViews(view3, Direction.Right), []);
assert.deepEqual(grid.getNeighborViews(view3, Direction.Down), []); assert.deepStrictEqual(grid.getNeighborViews(view3, Direction.Down), []);
assert.deepEqual(grid.getNeighborViews(view3, Direction.Left), []); assert.deepStrictEqual(grid.getNeighborViews(view3, Direction.Left), []);
assert.deepEqual(grid.getNeighborViews(view3, Direction.Up, true), [view2]); assert.deepStrictEqual(grid.getNeighborViews(view3, Direction.Up, true), [view2]);
assert.deepEqual(grid.getNeighborViews(view3, Direction.Right, true), [view3]); assert.deepStrictEqual(grid.getNeighborViews(view3, Direction.Right, true), [view3]);
assert.deepEqual(grid.getNeighborViews(view3, Direction.Down, true), [view1]); assert.deepStrictEqual(grid.getNeighborViews(view3, Direction.Down, true), [view1]);
assert.deepEqual(grid.getNeighborViews(view3, Direction.Left, true), [view3]); assert.deepStrictEqual(grid.getNeighborViews(view3, Direction.Left, true), [view3]);
}); });
test('getNeighborViews should work on a complex layout', function () { test('getNeighborViews should work on a complex layout', function () {
@ -398,26 +398,26 @@ suite('Grid', function () {
const view5 = new TestView(50, Number.MAX_VALUE, 50, Number.MAX_VALUE); const view5 = new TestView(50, Number.MAX_VALUE, 50, Number.MAX_VALUE);
grid.addView(view5, Sizing.Distribute, view4, Direction.Down); grid.addView(view5, Sizing.Distribute, view4, Direction.Down);
assert.deepEqual(grid.getNeighborViews(view1, Direction.Up), []); assert.deepStrictEqual(grid.getNeighborViews(view1, Direction.Up), []);
assert.deepEqual(grid.getNeighborViews(view1, Direction.Right), []); assert.deepStrictEqual(grid.getNeighborViews(view1, Direction.Right), []);
assert.deepEqual(grid.getNeighborViews(view1, Direction.Down), [view2, view4]); assert.deepStrictEqual(grid.getNeighborViews(view1, Direction.Down), [view2, view4]);
assert.deepEqual(grid.getNeighborViews(view1, Direction.Left), []); assert.deepStrictEqual(grid.getNeighborViews(view1, Direction.Left), []);
assert.deepEqual(grid.getNeighborViews(view2, Direction.Up), [view1]); assert.deepStrictEqual(grid.getNeighborViews(view2, Direction.Up), [view1]);
assert.deepEqual(grid.getNeighborViews(view2, Direction.Right), [view4, view5]); assert.deepStrictEqual(grid.getNeighborViews(view2, Direction.Right), [view4, view5]);
assert.deepEqual(grid.getNeighborViews(view2, Direction.Down), [view3]); assert.deepStrictEqual(grid.getNeighborViews(view2, Direction.Down), [view3]);
assert.deepEqual(grid.getNeighborViews(view2, Direction.Left), []); assert.deepStrictEqual(grid.getNeighborViews(view2, Direction.Left), []);
assert.deepEqual(grid.getNeighborViews(view4, Direction.Up), [view1]); assert.deepStrictEqual(grid.getNeighborViews(view4, Direction.Up), [view1]);
assert.deepEqual(grid.getNeighborViews(view4, Direction.Right), []); assert.deepStrictEqual(grid.getNeighborViews(view4, Direction.Right), []);
assert.deepEqual(grid.getNeighborViews(view4, Direction.Down), [view5]); assert.deepStrictEqual(grid.getNeighborViews(view4, Direction.Down), [view5]);
assert.deepEqual(grid.getNeighborViews(view4, Direction.Left), [view2]); assert.deepStrictEqual(grid.getNeighborViews(view4, Direction.Left), [view2]);
assert.deepEqual(grid.getNeighborViews(view5, Direction.Up), [view4]); assert.deepStrictEqual(grid.getNeighborViews(view5, Direction.Up), [view4]);
assert.deepEqual(grid.getNeighborViews(view5, Direction.Right), []); assert.deepStrictEqual(grid.getNeighborViews(view5, Direction.Right), []);
assert.deepEqual(grid.getNeighborViews(view5, Direction.Down), [view3]); assert.deepStrictEqual(grid.getNeighborViews(view5, Direction.Down), [view3]);
assert.deepEqual(grid.getNeighborViews(view5, Direction.Left), [view2]); assert.deepStrictEqual(grid.getNeighborViews(view5, Direction.Left), [view2]);
assert.deepEqual(grid.getNeighborViews(view3, Direction.Up), [view2, view5]); assert.deepStrictEqual(grid.getNeighborViews(view3, Direction.Up), [view2, view5]);
assert.deepEqual(grid.getNeighborViews(view3, Direction.Right), []); assert.deepStrictEqual(grid.getNeighborViews(view3, Direction.Right), []);
assert.deepEqual(grid.getNeighborViews(view3, Direction.Down), []); assert.deepStrictEqual(grid.getNeighborViews(view3, Direction.Down), []);
assert.deepEqual(grid.getNeighborViews(view3, Direction.Left), []); assert.deepStrictEqual(grid.getNeighborViews(view3, Direction.Left), []);
}); });
test('getNeighborViews should work on another simple layout', function () { test('getNeighborViews should work on another simple layout', function () {
@ -436,10 +436,10 @@ suite('Grid', function () {
const view4 = new TestView(50, Number.MAX_VALUE, 50, Number.MAX_VALUE); const view4 = new TestView(50, Number.MAX_VALUE, 50, Number.MAX_VALUE);
grid.addView(view4, Sizing.Distribute, view2, Direction.Right); grid.addView(view4, Sizing.Distribute, view2, Direction.Right);
assert.deepEqual(grid.getNeighborViews(view4, Direction.Up), []); assert.deepStrictEqual(grid.getNeighborViews(view4, Direction.Up), []);
assert.deepEqual(grid.getNeighborViews(view4, Direction.Right), []); assert.deepStrictEqual(grid.getNeighborViews(view4, Direction.Right), []);
assert.deepEqual(grid.getNeighborViews(view4, Direction.Down), [view3]); assert.deepStrictEqual(grid.getNeighborViews(view4, Direction.Down), [view3]);
assert.deepEqual(grid.getNeighborViews(view4, Direction.Left), [view2]); assert.deepStrictEqual(grid.getNeighborViews(view4, Direction.Left), [view2]);
}); });
test('getNeighborViews should only return immediate neighbors', function () { test('getNeighborViews should only return immediate neighbors', function () {
@ -458,7 +458,7 @@ suite('Grid', function () {
const view4 = new TestView(50, Number.MAX_VALUE, 50, Number.MAX_VALUE); const view4 = new TestView(50, Number.MAX_VALUE, 50, Number.MAX_VALUE);
grid.addView(view4, Sizing.Distribute, view2, Direction.Right); grid.addView(view4, Sizing.Distribute, view2, Direction.Right);
assert.deepEqual(grid.getNeighborViews(view1, Direction.Right), [view2, view3]); assert.deepStrictEqual(grid.getNeighborViews(view1, Direction.Right), [view2, view3]);
}); });
}); });
@ -524,7 +524,7 @@ suite('SerializableGrid', function () {
grid.layout(800, 600); grid.layout(800, 600);
const actual = grid.serialize(); const actual = grid.serialize();
assert.deepEqual(actual, { assert.deepStrictEqual(actual, {
orientation: 0, orientation: 0,
width: 800, width: 800,
height: 600, height: 600,
@ -562,7 +562,7 @@ suite('SerializableGrid', function () {
const view5 = new TestSerializableView('view5', 50, Number.MAX_VALUE, 50, Number.MAX_VALUE); const view5 = new TestSerializableView('view5', 50, Number.MAX_VALUE, 50, Number.MAX_VALUE);
grid.addView(view5, 100, view1, Direction.Down); grid.addView(view5, 100, view1, Direction.Down);
assert.deepEqual(grid.serialize(), { assert.deepStrictEqual(grid.serialize(), {
orientation: 0, orientation: 0,
width: 800, width: 800,
height: 600, height: 600,
@ -611,7 +611,7 @@ suite('SerializableGrid', function () {
const grid2 = SerializableGrid.deserialize(json, deserializer); const grid2 = SerializableGrid.deserialize(json, deserializer);
grid2.layout(800, 600); grid2.layout(800, 600);
assert.deepEqual(nodesToNames(grid2.getViews()), ['view1']); assert.deepStrictEqual(nodesToNames(grid2.getViews()), ['view1']);
}); });
test('deserialize simple layout', function () { test('deserialize simple layout', function () {
@ -645,15 +645,15 @@ suite('SerializableGrid', function () {
const view4Copy = deserializer.getView('view4'); const view4Copy = deserializer.getView('view4');
const view5Copy = deserializer.getView('view5'); const view5Copy = deserializer.getView('view5');
assert.deepEqual(nodesToArrays(grid2.getViews()), [[view4Copy, view2Copy], [[view1Copy, view5Copy], view3Copy]]); assert.deepStrictEqual(nodesToArrays(grid2.getViews()), [[view4Copy, view2Copy], [[view1Copy, view5Copy], view3Copy]]);
grid2.layout(800, 600); grid2.layout(800, 600);
assert.deepEqual(view1Copy.size, [600, 300]); assert.deepStrictEqual(view1Copy.size, [600, 300]);
assert.deepEqual(view2Copy.size, [600, 200]); assert.deepStrictEqual(view2Copy.size, [600, 200]);
assert.deepEqual(view3Copy.size, [200, 400]); assert.deepStrictEqual(view3Copy.size, [200, 400]);
assert.deepEqual(view4Copy.size, [200, 200]); assert.deepStrictEqual(view4Copy.size, [200, 200]);
assert.deepEqual(view5Copy.size, [600, 100]); assert.deepStrictEqual(view5Copy.size, [600, 100]);
}); });
test('deserialize simple layout with scaling', function () { test('deserialize simple layout with scaling', function () {
@ -688,11 +688,11 @@ suite('SerializableGrid', function () {
const view5Copy = deserializer.getView('view5'); const view5Copy = deserializer.getView('view5');
grid2.layout(400, 800); // [/2, *4/3] grid2.layout(400, 800); // [/2, *4/3]
assert.deepEqual(view1Copy.size, [300, 400]); assert.deepStrictEqual(view1Copy.size, [300, 400]);
assert.deepEqual(view2Copy.size, [300, 267]); assert.deepStrictEqual(view2Copy.size, [300, 267]);
assert.deepEqual(view3Copy.size, [100, 533]); assert.deepStrictEqual(view3Copy.size, [100, 533]);
assert.deepEqual(view4Copy.size, [100, 267]); assert.deepStrictEqual(view4Copy.size, [100, 267]);
assert.deepEqual(view5Copy.size, [300, 133]); assert.deepStrictEqual(view5Copy.size, [300, 133]);
}); });
test('deserialize 4 view layout (ben issue #2)', function () { test('deserialize 4 view layout (ben issue #2)', function () {
@ -723,10 +723,10 @@ suite('SerializableGrid', function () {
grid2.layout(800, 600); grid2.layout(800, 600);
assert.deepEqual(view1Copy.size, [800, 300]); assert.deepStrictEqual(view1Copy.size, [800, 300]);
assert.deepEqual(view2Copy.size, [800, 150]); assert.deepStrictEqual(view2Copy.size, [800, 150]);
assert.deepEqual(view3Copy.size, [400, 150]); assert.deepStrictEqual(view3Copy.size, [400, 150]);
assert.deepEqual(view4Copy.size, [400, 150]); assert.deepStrictEqual(view4Copy.size, [400, 150]);
}); });
test('deserialize 2 view layout (ben issue #3)', function () { test('deserialize 2 view layout (ben issue #3)', function () {
@ -750,8 +750,8 @@ suite('SerializableGrid', function () {
grid2.layout(800, 600); grid2.layout(800, 600);
assert.deepEqual(view1Copy.size, [400, 600]); assert.deepStrictEqual(view1Copy.size, [400, 600]);
assert.deepEqual(view2Copy.size, [400, 600]); assert.deepStrictEqual(view2Copy.size, [400, 600]);
}); });
test('deserialize simple view layout #50609', function () { test('deserialize simple view layout #50609', function () {
@ -780,21 +780,21 @@ suite('SerializableGrid', function () {
grid2.layout(800, 600); grid2.layout(800, 600);
assert.deepEqual(view2Copy.size, [800, 300]); assert.deepStrictEqual(view2Copy.size, [800, 300]);
assert.deepEqual(view3Copy.size, [800, 300]); assert.deepStrictEqual(view3Copy.size, [800, 300]);
}); });
test('sanitizeGridNodeDescriptor', () => { test('sanitizeGridNodeDescriptor', () => {
const nodeDescriptor = { groups: [{ size: 0.2 }, { size: 0.2 }, { size: 0.6, groups: [{}, {}] }] }; const nodeDescriptor = { groups: [{ size: 0.2 }, { size: 0.2 }, { size: 0.6, groups: [{}, {}] }] };
const nodeDescriptorCopy = deepClone<GridNodeDescriptor>(nodeDescriptor); const nodeDescriptorCopy = deepClone<GridNodeDescriptor>(nodeDescriptor);
sanitizeGridNodeDescriptor(nodeDescriptorCopy, true); sanitizeGridNodeDescriptor(nodeDescriptorCopy, true);
assert.deepEqual(nodeDescriptorCopy, { groups: [{ size: 0.2 }, { size: 0.2 }, { size: 0.6, groups: [{ size: 0.5 }, { size: 0.5 }] }] }); assert.deepStrictEqual(nodeDescriptorCopy, { groups: [{ size: 0.2 }, { size: 0.2 }, { size: 0.6, groups: [{ size: 0.5 }, { size: 0.5 }] }] });
}); });
test('createSerializedGrid', () => { test('createSerializedGrid', () => {
const gridDescriptor = { orientation: Orientation.VERTICAL, groups: [{ size: 0.2 }, { size: 0.2 }, { size: 0.6, groups: [{}, {}] }] }; const gridDescriptor = { orientation: Orientation.VERTICAL, groups: [{ size: 0.2 }, { size: 0.2 }, { size: 0.6, groups: [{}, {}] }] };
const serializedGrid = createSerializedGrid(gridDescriptor); const serializedGrid = createSerializedGrid(gridDescriptor);
assert.deepEqual(serializedGrid, { assert.deepStrictEqual(serializedGrid, {
root: { root: {
type: 'branch', type: 'branch',
size: undefined, size: undefined,
@ -860,40 +860,40 @@ suite('SerializableGrid', function () {
const view5 = new TestSerializableView('view5', 50, Number.MAX_VALUE, 50, Number.MAX_VALUE); const view5 = new TestSerializableView('view5', 50, Number.MAX_VALUE, 50, Number.MAX_VALUE);
grid.addView(view5, 100, view1, Direction.Down); grid.addView(view5, 100, view1, Direction.Down);
assert.deepEqual(view1.size, [600, 300]); assert.deepStrictEqual(view1.size, [600, 300]);
assert.deepEqual(view2.size, [600, 200]); assert.deepStrictEqual(view2.size, [600, 200]);
assert.deepEqual(view3.size, [200, 400]); assert.deepStrictEqual(view3.size, [200, 400]);
assert.deepEqual(view4.size, [200, 200]); assert.deepStrictEqual(view4.size, [200, 200]);
assert.deepEqual(view5.size, [600, 100]); assert.deepStrictEqual(view5.size, [600, 100]);
grid.setViewVisible(view5, false); grid.setViewVisible(view5, false);
assert.deepEqual(view1.size, [600, 400]); assert.deepStrictEqual(view1.size, [600, 400]);
assert.deepEqual(view2.size, [600, 200]); assert.deepStrictEqual(view2.size, [600, 200]);
assert.deepEqual(view3.size, [200, 400]); assert.deepStrictEqual(view3.size, [200, 400]);
assert.deepEqual(view4.size, [200, 200]); assert.deepStrictEqual(view4.size, [200, 200]);
assert.deepEqual(view5.size, [600, 0]); assert.deepStrictEqual(view5.size, [600, 0]);
grid.setViewVisible(view5, true); grid.setViewVisible(view5, true);
assert.deepEqual(view1.size, [600, 300]); assert.deepStrictEqual(view1.size, [600, 300]);
assert.deepEqual(view2.size, [600, 200]); assert.deepStrictEqual(view2.size, [600, 200]);
assert.deepEqual(view3.size, [200, 400]); assert.deepStrictEqual(view3.size, [200, 400]);
assert.deepEqual(view4.size, [200, 200]); assert.deepStrictEqual(view4.size, [200, 200]);
assert.deepEqual(view5.size, [600, 100]); assert.deepStrictEqual(view5.size, [600, 100]);
grid.setViewVisible(view5, false); grid.setViewVisible(view5, false);
assert.deepEqual(view1.size, [600, 400]); assert.deepStrictEqual(view1.size, [600, 400]);
assert.deepEqual(view2.size, [600, 200]); assert.deepStrictEqual(view2.size, [600, 200]);
assert.deepEqual(view3.size, [200, 400]); assert.deepStrictEqual(view3.size, [200, 400]);
assert.deepEqual(view4.size, [200, 200]); assert.deepStrictEqual(view4.size, [200, 200]);
assert.deepEqual(view5.size, [600, 0]); assert.deepStrictEqual(view5.size, [600, 0]);
grid.setViewVisible(view5, false); grid.setViewVisible(view5, false);
const json = grid.serialize(); const json = grid.serialize();
assert.deepEqual(json, { assert.deepStrictEqual(json, {
orientation: 0, orientation: 0,
width: 800, width: 800,
height: 600, height: 600,
@ -939,34 +939,34 @@ suite('SerializableGrid', function () {
const view4Copy = deserializer.getView('view4'); const view4Copy = deserializer.getView('view4');
const view5Copy = deserializer.getView('view5'); const view5Copy = deserializer.getView('view5');
assert.deepEqual(nodesToArrays(grid2.getViews()), [[view4Copy, view2Copy], [[view1Copy, view5Copy], view3Copy]]); assert.deepStrictEqual(nodesToArrays(grid2.getViews()), [[view4Copy, view2Copy], [[view1Copy, view5Copy], view3Copy]]);
grid2.layout(800, 600); grid2.layout(800, 600);
assert.deepEqual(view1Copy.size, [600, 400]); assert.deepStrictEqual(view1Copy.size, [600, 400]);
assert.deepEqual(view2Copy.size, [600, 200]); assert.deepStrictEqual(view2Copy.size, [600, 200]);
assert.deepEqual(view3Copy.size, [200, 400]); assert.deepStrictEqual(view3Copy.size, [200, 400]);
assert.deepEqual(view4Copy.size, [200, 200]); assert.deepStrictEqual(view4Copy.size, [200, 200]);
assert.deepEqual(view5Copy.size, [600, 0]); assert.deepStrictEqual(view5Copy.size, [600, 0]);
assert.deepEqual(grid2.isViewVisible(view1Copy), true); assert.deepStrictEqual(grid2.isViewVisible(view1Copy), true);
assert.deepEqual(grid2.isViewVisible(view2Copy), true); assert.deepStrictEqual(grid2.isViewVisible(view2Copy), true);
assert.deepEqual(grid2.isViewVisible(view3Copy), true); assert.deepStrictEqual(grid2.isViewVisible(view3Copy), true);
assert.deepEqual(grid2.isViewVisible(view4Copy), true); assert.deepStrictEqual(grid2.isViewVisible(view4Copy), true);
assert.deepEqual(grid2.isViewVisible(view5Copy), false); assert.deepStrictEqual(grid2.isViewVisible(view5Copy), false);
grid2.setViewVisible(view5Copy, true); grid2.setViewVisible(view5Copy, true);
assert.deepEqual(view1Copy.size, [600, 300]); assert.deepStrictEqual(view1Copy.size, [600, 300]);
assert.deepEqual(view2Copy.size, [600, 200]); assert.deepStrictEqual(view2Copy.size, [600, 200]);
assert.deepEqual(view3Copy.size, [200, 400]); assert.deepStrictEqual(view3Copy.size, [200, 400]);
assert.deepEqual(view4Copy.size, [200, 200]); assert.deepStrictEqual(view4Copy.size, [200, 200]);
assert.deepEqual(view5Copy.size, [600, 100]); assert.deepStrictEqual(view5Copy.size, [600, 100]);
assert.deepEqual(grid2.isViewVisible(view1Copy), true); assert.deepStrictEqual(grid2.isViewVisible(view1Copy), true);
assert.deepEqual(grid2.isViewVisible(view2Copy), true); assert.deepStrictEqual(grid2.isViewVisible(view2Copy), true);
assert.deepEqual(grid2.isViewVisible(view3Copy), true); assert.deepStrictEqual(grid2.isViewVisible(view3Copy), true);
assert.deepEqual(grid2.isViewVisible(view4Copy), true); assert.deepStrictEqual(grid2.isViewVisible(view4Copy), true);
assert.deepEqual(grid2.isViewVisible(view5Copy), true); assert.deepStrictEqual(grid2.isViewVisible(view5Copy), true);
}); });
test('serialize should store visibility and previous size even for first leaf', function () { test('serialize should store visibility and previous size even for first leaf', function () {
@ -987,22 +987,22 @@ suite('SerializableGrid', function () {
const view5 = new TestSerializableView('view5', 50, Number.MAX_VALUE, 50, Number.MAX_VALUE); const view5 = new TestSerializableView('view5', 50, Number.MAX_VALUE, 50, Number.MAX_VALUE);
grid.addView(view5, 100, view1, Direction.Down); grid.addView(view5, 100, view1, Direction.Down);
assert.deepEqual(view1.size, [600, 300]); assert.deepStrictEqual(view1.size, [600, 300]);
assert.deepEqual(view2.size, [600, 200]); assert.deepStrictEqual(view2.size, [600, 200]);
assert.deepEqual(view3.size, [200, 400]); assert.deepStrictEqual(view3.size, [200, 400]);
assert.deepEqual(view4.size, [200, 200]); assert.deepStrictEqual(view4.size, [200, 200]);
assert.deepEqual(view5.size, [600, 100]); assert.deepStrictEqual(view5.size, [600, 100]);
grid.setViewVisible(view4, false); grid.setViewVisible(view4, false);
assert.deepEqual(view1.size, [600, 300]); assert.deepStrictEqual(view1.size, [600, 300]);
assert.deepEqual(view2.size, [800, 200]); assert.deepStrictEqual(view2.size, [800, 200]);
assert.deepEqual(view3.size, [200, 400]); assert.deepStrictEqual(view3.size, [200, 400]);
assert.deepEqual(view4.size, [0, 200]); assert.deepStrictEqual(view4.size, [0, 200]);
assert.deepEqual(view5.size, [600, 100]); assert.deepStrictEqual(view5.size, [600, 100]);
const json = grid.serialize(); const json = grid.serialize();
assert.deepEqual(json, { assert.deepStrictEqual(json, {
orientation: 0, orientation: 0,
width: 800, width: 800,
height: 600, height: 600,
@ -1048,33 +1048,33 @@ suite('SerializableGrid', function () {
const view4Copy = deserializer.getView('view4'); const view4Copy = deserializer.getView('view4');
const view5Copy = deserializer.getView('view5'); const view5Copy = deserializer.getView('view5');
assert.deepEqual(nodesToArrays(grid2.getViews()), [[view4Copy, view2Copy], [[view1Copy, view5Copy], view3Copy]]); assert.deepStrictEqual(nodesToArrays(grid2.getViews()), [[view4Copy, view2Copy], [[view1Copy, view5Copy], view3Copy]]);
grid2.layout(800, 600); grid2.layout(800, 600);
assert.deepEqual(view1Copy.size, [600, 300]); assert.deepStrictEqual(view1Copy.size, [600, 300]);
assert.deepEqual(view2Copy.size, [800, 200]); assert.deepStrictEqual(view2Copy.size, [800, 200]);
assert.deepEqual(view3Copy.size, [200, 400]); assert.deepStrictEqual(view3Copy.size, [200, 400]);
assert.deepEqual(view4Copy.size, [0, 200]); assert.deepStrictEqual(view4Copy.size, [0, 200]);
assert.deepEqual(view5Copy.size, [600, 100]); assert.deepStrictEqual(view5Copy.size, [600, 100]);
assert.deepEqual(grid2.isViewVisible(view1Copy), true); assert.deepStrictEqual(grid2.isViewVisible(view1Copy), true);
assert.deepEqual(grid2.isViewVisible(view2Copy), true); assert.deepStrictEqual(grid2.isViewVisible(view2Copy), true);
assert.deepEqual(grid2.isViewVisible(view3Copy), true); assert.deepStrictEqual(grid2.isViewVisible(view3Copy), true);
assert.deepEqual(grid2.isViewVisible(view4Copy), false); assert.deepStrictEqual(grid2.isViewVisible(view4Copy), false);
assert.deepEqual(grid2.isViewVisible(view5Copy), true); assert.deepStrictEqual(grid2.isViewVisible(view5Copy), true);
grid2.setViewVisible(view4Copy, true); grid2.setViewVisible(view4Copy, true);
assert.deepEqual(view1Copy.size, [600, 300]); assert.deepStrictEqual(view1Copy.size, [600, 300]);
assert.deepEqual(view2Copy.size, [600, 200]); assert.deepStrictEqual(view2Copy.size, [600, 200]);
assert.deepEqual(view3Copy.size, [200, 400]); assert.deepStrictEqual(view3Copy.size, [200, 400]);
assert.deepEqual(view4Copy.size, [200, 200]); assert.deepStrictEqual(view4Copy.size, [200, 200]);
assert.deepEqual(view5Copy.size, [600, 100]); assert.deepStrictEqual(view5Copy.size, [600, 100]);
assert.deepEqual(grid2.isViewVisible(view1Copy), true); assert.deepStrictEqual(grid2.isViewVisible(view1Copy), true);
assert.deepEqual(grid2.isViewVisible(view2Copy), true); assert.deepStrictEqual(grid2.isViewVisible(view2Copy), true);
assert.deepEqual(grid2.isViewVisible(view3Copy), true); assert.deepStrictEqual(grid2.isViewVisible(view3Copy), true);
assert.deepEqual(grid2.isViewVisible(view4Copy), true); assert.deepStrictEqual(grid2.isViewVisible(view4Copy), true);
assert.deepEqual(grid2.isViewVisible(view5Copy), true); assert.deepStrictEqual(grid2.isViewVisible(view5Copy), true);
}); });
}); });

View file

@ -22,7 +22,7 @@ suite('Gridview', function () {
}); });
test('empty gridview is empty', function () { test('empty gridview is empty', function () {
assert.deepEqual(nodesToArrays(gridview.getView()), []); assert.deepStrictEqual(nodesToArrays(gridview.getView()), []);
gridview.dispose(); gridview.dispose();
}); });
@ -43,7 +43,7 @@ suite('Gridview', function () {
gridview.addView(views[1], 200, [1]); gridview.addView(views[1], 200, [1]);
gridview.addView(views[2], 200, [2]); gridview.addView(views[2], 200, [2]);
assert.deepEqual(nodesToArrays(gridview.getView()), views); assert.deepStrictEqual(nodesToArrays(gridview.getView()), views);
gridview.dispose(); gridview.dispose();
}); });
@ -62,7 +62,7 @@ suite('Gridview', function () {
gridview.addView((views[1] as TestView[])[0] as IView, 200, [1]); gridview.addView((views[1] as TestView[])[0] as IView, 200, [1]);
gridview.addView((views[1] as TestView[])[1] as IView, 200, [1, 1]); gridview.addView((views[1] as TestView[])[1] as IView, 200, [1, 1]);
assert.deepEqual(nodesToArrays(gridview.getView()), views); assert.deepStrictEqual(nodesToArrays(gridview.getView()), views);
gridview.dispose(); gridview.dispose();
}); });
@ -71,35 +71,35 @@ suite('Gridview', function () {
const view1 = new TestView(20, 20, 20, 20); const view1 = new TestView(20, 20, 20, 20);
gridview.addView(view1 as IView, 200, [0]); gridview.addView(view1 as IView, 200, [0]);
assert.deepEqual(nodesToArrays(gridview.getView()), [view1]); assert.deepStrictEqual(nodesToArrays(gridview.getView()), [view1]);
const view2 = new TestView(20, 20, 20, 20); const view2 = new TestView(20, 20, 20, 20);
gridview.addView(view2 as IView, 200, [1]); gridview.addView(view2 as IView, 200, [1]);
assert.deepEqual(nodesToArrays(gridview.getView()), [view1, view2]); assert.deepStrictEqual(nodesToArrays(gridview.getView()), [view1, view2]);
const view3 = new TestView(20, 20, 20, 20); const view3 = new TestView(20, 20, 20, 20);
gridview.addView(view3 as IView, 200, [1, 0]); gridview.addView(view3 as IView, 200, [1, 0]);
assert.deepEqual(nodesToArrays(gridview.getView()), [view1, [view3, view2]]); assert.deepStrictEqual(nodesToArrays(gridview.getView()), [view1, [view3, view2]]);
const view4 = new TestView(20, 20, 20, 20); const view4 = new TestView(20, 20, 20, 20);
gridview.addView(view4 as IView, 200, [1, 0, 0]); gridview.addView(view4 as IView, 200, [1, 0, 0]);
assert.deepEqual(nodesToArrays(gridview.getView()), [view1, [[view4, view3], view2]]); assert.deepStrictEqual(nodesToArrays(gridview.getView()), [view1, [[view4, view3], view2]]);
const view5 = new TestView(20, 20, 20, 20); const view5 = new TestView(20, 20, 20, 20);
gridview.addView(view5 as IView, 200, [1, 0]); gridview.addView(view5 as IView, 200, [1, 0]);
assert.deepEqual(nodesToArrays(gridview.getView()), [view1, [view5, [view4, view3], view2]]); assert.deepStrictEqual(nodesToArrays(gridview.getView()), [view1, [view5, [view4, view3], view2]]);
const view6 = new TestView(20, 20, 20, 20); const view6 = new TestView(20, 20, 20, 20);
gridview.addView(view6 as IView, 200, [2]); gridview.addView(view6 as IView, 200, [2]);
assert.deepEqual(nodesToArrays(gridview.getView()), [view1, [view5, [view4, view3], view2], view6]); assert.deepStrictEqual(nodesToArrays(gridview.getView()), [view1, [view5, [view4, view3], view2], view6]);
const view7 = new TestView(20, 20, 20, 20); const view7 = new TestView(20, 20, 20, 20);
gridview.addView(view7 as IView, 200, [1, 1]); gridview.addView(view7 as IView, 200, [1, 1]);
assert.deepEqual(nodesToArrays(gridview.getView()), [view1, [view5, view7, [view4, view3], view2], view6]); assert.deepStrictEqual(nodesToArrays(gridview.getView()), [view1, [view5, view7, [view4, view3], view2], view6]);
const view8 = new TestView(20, 20, 20, 20); const view8 = new TestView(20, 20, 20, 20);
gridview.addView(view8 as IView, 200, [1, 1, 0]); gridview.addView(view8 as IView, 200, [1, 1, 0]);
assert.deepEqual(nodesToArrays(gridview.getView()), [view1, [view5, [view8, view7], [view4, view3], view2], view6]); assert.deepStrictEqual(nodesToArrays(gridview.getView()), [view1, [view5, [view8, view7], [view4, view3], view2], view6]);
gridview.dispose(); gridview.dispose();
}); });
@ -109,48 +109,48 @@ suite('Gridview', function () {
const view1 = new TestView(50, Number.POSITIVE_INFINITY, 50, Number.POSITIVE_INFINITY); const view1 = new TestView(50, Number.POSITIVE_INFINITY, 50, Number.POSITIVE_INFINITY);
gridview.addView(view1, 200, [0]); gridview.addView(view1, 200, [0]);
assert.deepEqual(view1.size, [800, 600]); assert.deepStrictEqual(view1.size, [800, 600]);
assert.deepEqual(gridview.getViewSize([0]), { width: 800, height: 600 }); assert.deepStrictEqual(gridview.getViewSize([0]), { width: 800, height: 600 });
const view2 = new TestView(50, Number.POSITIVE_INFINITY, 50, Number.POSITIVE_INFINITY); const view2 = new TestView(50, Number.POSITIVE_INFINITY, 50, Number.POSITIVE_INFINITY);
gridview.addView(view2, 200, [0]); gridview.addView(view2, 200, [0]);
assert.deepEqual(view1.size, [800, 400]); assert.deepStrictEqual(view1.size, [800, 400]);
assert.deepEqual(gridview.getViewSize([1]), { width: 800, height: 400 }); assert.deepStrictEqual(gridview.getViewSize([1]), { width: 800, height: 400 });
assert.deepEqual(view2.size, [800, 200]); assert.deepStrictEqual(view2.size, [800, 200]);
assert.deepEqual(gridview.getViewSize([0]), { width: 800, height: 200 }); assert.deepStrictEqual(gridview.getViewSize([0]), { width: 800, height: 200 });
const view3 = new TestView(50, Number.POSITIVE_INFINITY, 50, Number.POSITIVE_INFINITY); const view3 = new TestView(50, Number.POSITIVE_INFINITY, 50, Number.POSITIVE_INFINITY);
gridview.addView(view3, 200, [1, 1]); gridview.addView(view3, 200, [1, 1]);
assert.deepEqual(view1.size, [600, 400]); assert.deepStrictEqual(view1.size, [600, 400]);
assert.deepEqual(gridview.getViewSize([1, 0]), { width: 600, height: 400 }); assert.deepStrictEqual(gridview.getViewSize([1, 0]), { width: 600, height: 400 });
assert.deepEqual(view2.size, [800, 200]); assert.deepStrictEqual(view2.size, [800, 200]);
assert.deepEqual(gridview.getViewSize([0]), { width: 800, height: 200 }); assert.deepStrictEqual(gridview.getViewSize([0]), { width: 800, height: 200 });
assert.deepEqual(view3.size, [200, 400]); assert.deepStrictEqual(view3.size, [200, 400]);
assert.deepEqual(gridview.getViewSize([1, 1]), { width: 200, height: 400 }); assert.deepStrictEqual(gridview.getViewSize([1, 1]), { width: 200, height: 400 });
const view4 = new TestView(50, Number.POSITIVE_INFINITY, 50, Number.POSITIVE_INFINITY); const view4 = new TestView(50, Number.POSITIVE_INFINITY, 50, Number.POSITIVE_INFINITY);
gridview.addView(view4, 200, [0, 0]); gridview.addView(view4, 200, [0, 0]);
assert.deepEqual(view1.size, [600, 400]); assert.deepStrictEqual(view1.size, [600, 400]);
assert.deepEqual(gridview.getViewSize([1, 0]), { width: 600, height: 400 }); assert.deepStrictEqual(gridview.getViewSize([1, 0]), { width: 600, height: 400 });
assert.deepEqual(view2.size, [600, 200]); assert.deepStrictEqual(view2.size, [600, 200]);
assert.deepEqual(gridview.getViewSize([0, 1]), { width: 600, height: 200 }); assert.deepStrictEqual(gridview.getViewSize([0, 1]), { width: 600, height: 200 });
assert.deepEqual(view3.size, [200, 400]); assert.deepStrictEqual(view3.size, [200, 400]);
assert.deepEqual(gridview.getViewSize([1, 1]), { width: 200, height: 400 }); assert.deepStrictEqual(gridview.getViewSize([1, 1]), { width: 200, height: 400 });
assert.deepEqual(view4.size, [200, 200]); assert.deepStrictEqual(view4.size, [200, 200]);
assert.deepEqual(gridview.getViewSize([0, 0]), { width: 200, height: 200 }); assert.deepStrictEqual(gridview.getViewSize([0, 0]), { width: 200, height: 200 });
const view5 = new TestView(50, Number.POSITIVE_INFINITY, 50, Number.POSITIVE_INFINITY); const view5 = new TestView(50, Number.POSITIVE_INFINITY, 50, Number.POSITIVE_INFINITY);
gridview.addView(view5, 100, [1, 0, 1]); gridview.addView(view5, 100, [1, 0, 1]);
assert.deepEqual(view1.size, [600, 300]); assert.deepStrictEqual(view1.size, [600, 300]);
assert.deepEqual(gridview.getViewSize([1, 0, 0]), { width: 600, height: 300 }); assert.deepStrictEqual(gridview.getViewSize([1, 0, 0]), { width: 600, height: 300 });
assert.deepEqual(view2.size, [600, 200]); assert.deepStrictEqual(view2.size, [600, 200]);
assert.deepEqual(gridview.getViewSize([0, 1]), { width: 600, height: 200 }); assert.deepStrictEqual(gridview.getViewSize([0, 1]), { width: 600, height: 200 });
assert.deepEqual(view3.size, [200, 400]); assert.deepStrictEqual(view3.size, [200, 400]);
assert.deepEqual(gridview.getViewSize([1, 1]), { width: 200, height: 400 }); assert.deepStrictEqual(gridview.getViewSize([1, 1]), { width: 200, height: 400 });
assert.deepEqual(view4.size, [200, 200]); assert.deepStrictEqual(view4.size, [200, 200]);
assert.deepEqual(gridview.getViewSize([0, 0]), { width: 200, height: 200 }); assert.deepStrictEqual(gridview.getViewSize([0, 0]), { width: 200, height: 200 });
assert.deepEqual(view5.size, [600, 100]); assert.deepStrictEqual(view5.size, [600, 100]);
assert.deepEqual(gridview.getViewSize([1, 0, 1]), { width: 600, height: 100 }); assert.deepStrictEqual(gridview.getViewSize([1, 0, 1]), { width: 600, height: 100 });
}); });
test('simple layout with automatic size distribution', function () { test('simple layout with automatic size distribution', function () {
@ -158,34 +158,34 @@ suite('Gridview', function () {
const view1 = new TestView(50, Number.POSITIVE_INFINITY, 50, Number.POSITIVE_INFINITY); const view1 = new TestView(50, Number.POSITIVE_INFINITY, 50, Number.POSITIVE_INFINITY);
gridview.addView(view1, Sizing.Distribute, [0]); gridview.addView(view1, Sizing.Distribute, [0]);
assert.deepEqual(view1.size, [800, 600]); assert.deepStrictEqual(view1.size, [800, 600]);
assert.deepEqual(gridview.getViewSize([0]), { width: 800, height: 600 }); assert.deepStrictEqual(gridview.getViewSize([0]), { width: 800, height: 600 });
const view2 = new TestView(50, Number.POSITIVE_INFINITY, 50, Number.POSITIVE_INFINITY); const view2 = new TestView(50, Number.POSITIVE_INFINITY, 50, Number.POSITIVE_INFINITY);
gridview.addView(view2, Sizing.Distribute, [0]); gridview.addView(view2, Sizing.Distribute, [0]);
assert.deepEqual(view1.size, [800, 300]); assert.deepStrictEqual(view1.size, [800, 300]);
assert.deepEqual(view2.size, [800, 300]); assert.deepStrictEqual(view2.size, [800, 300]);
const view3 = new TestView(50, Number.POSITIVE_INFINITY, 50, Number.POSITIVE_INFINITY); const view3 = new TestView(50, Number.POSITIVE_INFINITY, 50, Number.POSITIVE_INFINITY);
gridview.addView(view3, Sizing.Distribute, [1, 1]); gridview.addView(view3, Sizing.Distribute, [1, 1]);
assert.deepEqual(view1.size, [400, 300]); assert.deepStrictEqual(view1.size, [400, 300]);
assert.deepEqual(view2.size, [800, 300]); assert.deepStrictEqual(view2.size, [800, 300]);
assert.deepEqual(view3.size, [400, 300]); assert.deepStrictEqual(view3.size, [400, 300]);
const view4 = new TestView(50, Number.POSITIVE_INFINITY, 50, Number.POSITIVE_INFINITY); const view4 = new TestView(50, Number.POSITIVE_INFINITY, 50, Number.POSITIVE_INFINITY);
gridview.addView(view4, Sizing.Distribute, [0, 0]); gridview.addView(view4, Sizing.Distribute, [0, 0]);
assert.deepEqual(view1.size, [400, 300]); assert.deepStrictEqual(view1.size, [400, 300]);
assert.deepEqual(view2.size, [400, 300]); assert.deepStrictEqual(view2.size, [400, 300]);
assert.deepEqual(view3.size, [400, 300]); assert.deepStrictEqual(view3.size, [400, 300]);
assert.deepEqual(view4.size, [400, 300]); assert.deepStrictEqual(view4.size, [400, 300]);
const view5 = new TestView(50, Number.POSITIVE_INFINITY, 50, Number.POSITIVE_INFINITY); const view5 = new TestView(50, Number.POSITIVE_INFINITY, 50, Number.POSITIVE_INFINITY);
gridview.addView(view5, Sizing.Distribute, [1, 0, 1]); gridview.addView(view5, Sizing.Distribute, [1, 0, 1]);
assert.deepEqual(view1.size, [400, 150]); assert.deepStrictEqual(view1.size, [400, 150]);
assert.deepEqual(view2.size, [400, 300]); assert.deepStrictEqual(view2.size, [400, 300]);
assert.deepEqual(view3.size, [400, 300]); assert.deepStrictEqual(view3.size, [400, 300]);
assert.deepEqual(view4.size, [400, 300]); assert.deepStrictEqual(view4.size, [400, 300]);
assert.deepEqual(view5.size, [400, 150]); assert.deepStrictEqual(view5.size, [400, 150]);
}); });
test('addviews before layout call 1', function () { test('addviews before layout call 1', function () {
@ -201,9 +201,9 @@ suite('Gridview', function () {
gridview.layout(800, 600); gridview.layout(800, 600);
assert.deepEqual(view1.size, [400, 300]); assert.deepStrictEqual(view1.size, [400, 300]);
assert.deepEqual(view2.size, [800, 300]); assert.deepStrictEqual(view2.size, [800, 300]);
assert.deepEqual(view3.size, [400, 300]); assert.deepStrictEqual(view3.size, [400, 300]);
}); });
test('addviews before layout call 2', function () { test('addviews before layout call 2', function () {
@ -218,8 +218,8 @@ suite('Gridview', function () {
gridview.layout(800, 600); gridview.layout(800, 600);
assert.deepEqual(view1.size, [800, 300]); assert.deepStrictEqual(view1.size, [800, 300]);
assert.deepEqual(view2.size, [400, 300]); assert.deepStrictEqual(view2.size, [400, 300]);
assert.deepEqual(view3.size, [400, 300]); assert.deepStrictEqual(view3.size, [400, 300]);
}); });
}); });

View file

@ -15,24 +15,24 @@ suite('RangeMap', () => {
}); });
test('intersection', () => { test('intersection', () => {
assert.deepEqual(Range.intersect({ start: 0, end: 0 }, { start: 0, end: 0 }), { start: 0, end: 0 }); assert.deepStrictEqual(Range.intersect({ start: 0, end: 0 }, { start: 0, end: 0 }), { start: 0, end: 0 });
assert.deepEqual(Range.intersect({ start: 0, end: 0 }, { start: 5, end: 5 }), { start: 0, end: 0 }); assert.deepStrictEqual(Range.intersect({ start: 0, end: 0 }, { start: 5, end: 5 }), { start: 0, end: 0 });
assert.deepEqual(Range.intersect({ start: 0, end: 1 }, { start: 5, end: 6 }), { start: 0, end: 0 }); assert.deepStrictEqual(Range.intersect({ start: 0, end: 1 }, { start: 5, end: 6 }), { start: 0, end: 0 });
assert.deepEqual(Range.intersect({ start: 5, end: 6 }, { start: 0, end: 1 }), { start: 0, end: 0 }); assert.deepStrictEqual(Range.intersect({ start: 5, end: 6 }, { start: 0, end: 1 }), { start: 0, end: 0 });
assert.deepEqual(Range.intersect({ start: 0, end: 5 }, { start: 2, end: 2 }), { start: 0, end: 0 }); assert.deepStrictEqual(Range.intersect({ start: 0, end: 5 }, { start: 2, end: 2 }), { start: 0, end: 0 });
assert.deepEqual(Range.intersect({ start: 0, end: 1 }, { start: 0, end: 1 }), { start: 0, end: 1 }); assert.deepStrictEqual(Range.intersect({ start: 0, end: 1 }, { start: 0, end: 1 }), { start: 0, end: 1 });
assert.deepEqual(Range.intersect({ start: 0, end: 10 }, { start: 0, end: 5 }), { start: 0, end: 5 }); assert.deepStrictEqual(Range.intersect({ start: 0, end: 10 }, { start: 0, end: 5 }), { start: 0, end: 5 });
assert.deepEqual(Range.intersect({ start: 0, end: 5 }, { start: 0, end: 10 }), { start: 0, end: 5 }); assert.deepStrictEqual(Range.intersect({ start: 0, end: 5 }, { start: 0, end: 10 }), { start: 0, end: 5 });
assert.deepEqual(Range.intersect({ start: 0, end: 10 }, { start: 5, end: 10 }), { start: 5, end: 10 }); assert.deepStrictEqual(Range.intersect({ start: 0, end: 10 }, { start: 5, end: 10 }), { start: 5, end: 10 });
assert.deepEqual(Range.intersect({ start: 5, end: 10 }, { start: 0, end: 10 }), { start: 5, end: 10 }); assert.deepStrictEqual(Range.intersect({ start: 5, end: 10 }, { start: 0, end: 10 }), { start: 5, end: 10 });
assert.deepEqual(Range.intersect({ start: 0, end: 10 }, { start: 2, end: 8 }), { start: 2, end: 8 }); assert.deepStrictEqual(Range.intersect({ start: 0, end: 10 }, { start: 2, end: 8 }), { start: 2, end: 8 });
assert.deepEqual(Range.intersect({ start: 2, end: 8 }, { start: 0, end: 10 }), { start: 2, end: 8 }); assert.deepStrictEqual(Range.intersect({ start: 2, end: 8 }, { start: 0, end: 10 }), { start: 2, end: 8 });
assert.deepEqual(Range.intersect({ start: 0, end: 10 }, { start: 5, end: 15 }), { start: 5, end: 10 }); assert.deepStrictEqual(Range.intersect({ start: 0, end: 10 }, { start: 5, end: 15 }), { start: 5, end: 10 });
assert.deepEqual(Range.intersect({ start: 5, end: 15 }, { start: 0, end: 10 }), { start: 5, end: 10 }); assert.deepStrictEqual(Range.intersect({ start: 5, end: 15 }, { start: 0, end: 10 }), { start: 5, end: 10 });
}); });
test('multiIntersect', () => { test('multiIntersect', () => {
assert.deepEqual( assert.deepStrictEqual(
groupIntersect( groupIntersect(
{ start: 0, end: 0 }, { start: 0, end: 0 },
[{ range: { start: 0, end: 10 }, size: 1 }] [{ range: { start: 0, end: 10 }, size: 1 }]
@ -40,7 +40,7 @@ suite('RangeMap', () => {
[] []
); );
assert.deepEqual( assert.deepStrictEqual(
groupIntersect( groupIntersect(
{ start: 10, end: 20 }, { start: 10, end: 20 },
[{ range: { start: 0, end: 10 }, size: 1 }] [{ range: { start: 0, end: 10 }, size: 1 }]
@ -48,7 +48,7 @@ suite('RangeMap', () => {
[] []
); );
assert.deepEqual( assert.deepStrictEqual(
groupIntersect( groupIntersect(
{ start: 2, end: 8 }, { start: 2, end: 8 },
[{ range: { start: 0, end: 10 }, size: 1 }] [{ range: { start: 0, end: 10 }, size: 1 }]
@ -56,7 +56,7 @@ suite('RangeMap', () => {
[{ range: { start: 2, end: 8 }, size: 1 }] [{ range: { start: 2, end: 8 }, size: 1 }]
); );
assert.deepEqual( assert.deepStrictEqual(
groupIntersect( groupIntersect(
{ start: 2, end: 8 }, { start: 2, end: 8 },
[{ range: { start: 0, end: 10 }, size: 1 }, { range: { start: 10, end: 20 }, size: 5 }] [{ range: { start: 0, end: 10 }, size: 1 }, { range: { start: 10, end: 20 }, size: 5 }]
@ -64,7 +64,7 @@ suite('RangeMap', () => {
[{ range: { start: 2, end: 8 }, size: 1 }] [{ range: { start: 2, end: 8 }, size: 1 }]
); );
assert.deepEqual( assert.deepStrictEqual(
groupIntersect( groupIntersect(
{ start: 12, end: 18 }, { start: 12, end: 18 },
[{ range: { start: 0, end: 10 }, size: 1 }, { range: { start: 10, end: 20 }, size: 5 }] [{ range: { start: 0, end: 10 }, size: 1 }, { range: { start: 10, end: 20 }, size: 5 }]
@ -72,7 +72,7 @@ suite('RangeMap', () => {
[{ range: { start: 12, end: 18 }, size: 5 }] [{ range: { start: 12, end: 18 }, size: 5 }]
); );
assert.deepEqual( assert.deepStrictEqual(
groupIntersect( groupIntersect(
{ start: 2, end: 18 }, { start: 2, end: 18 },
[{ range: { start: 0, end: 10 }, size: 1 }, { range: { start: 10, end: 20 }, size: 5 }] [{ range: { start: 0, end: 10 }, size: 1 }, { range: { start: 10, end: 20 }, size: 5 }]
@ -80,7 +80,7 @@ suite('RangeMap', () => {
[{ range: { start: 2, end: 10 }, size: 1 }, { range: { start: 10, end: 18 }, size: 5 }] [{ range: { start: 2, end: 10 }, size: 1 }, { range: { start: 10, end: 18 }, size: 5 }]
); );
assert.deepEqual( assert.deepStrictEqual(
groupIntersect( groupIntersect(
{ start: 2, end: 28 }, { start: 2, end: 28 },
[{ range: { start: 0, end: 10 }, size: 1 }, { range: { start: 10, end: 20 }, size: 5 }, { range: { start: 20, end: 30 }, size: 10 }] [{ range: { start: 0, end: 10 }, size: 1 }, { range: { start: 10, end: 20 }, size: 5 }, { range: { start: 20, end: 30 }, size: 10 }]
@ -90,14 +90,14 @@ suite('RangeMap', () => {
}); });
test('consolidate', () => { test('consolidate', () => {
assert.deepEqual(consolidate([]), []); assert.deepStrictEqual(consolidate([]), []);
assert.deepEqual( assert.deepStrictEqual(
consolidate([{ range: { start: 0, end: 10 }, size: 1 }]), consolidate([{ range: { start: 0, end: 10 }, size: 1 }]),
[{ range: { start: 0, end: 10 }, size: 1 }] [{ range: { start: 0, end: 10 }, size: 1 }]
); );
assert.deepEqual( assert.deepStrictEqual(
consolidate([ consolidate([
{ range: { start: 0, end: 10 }, size: 1 }, { range: { start: 0, end: 10 }, size: 1 },
{ range: { start: 10, end: 20 }, size: 1 } { range: { start: 10, end: 20 }, size: 1 }
@ -105,7 +105,7 @@ suite('RangeMap', () => {
[{ range: { start: 0, end: 20 }, size: 1 }] [{ range: { start: 0, end: 20 }, size: 1 }]
); );
assert.deepEqual( assert.deepStrictEqual(
consolidate([ consolidate([
{ range: { start: 0, end: 10 }, size: 1 }, { range: { start: 0, end: 10 }, size: 1 },
{ range: { start: 10, end: 20 }, size: 1 }, { range: { start: 10, end: 20 }, size: 1 },
@ -114,7 +114,7 @@ suite('RangeMap', () => {
[{ range: { start: 0, end: 100 }, size: 1 }] [{ range: { start: 0, end: 100 }, size: 1 }]
); );
assert.deepEqual( assert.deepStrictEqual(
consolidate([ consolidate([
{ range: { start: 0, end: 10 }, size: 1 }, { range: { start: 0, end: 10 }, size: 1 },
{ range: { start: 10, end: 20 }, size: 5 }, { range: { start: 10, end: 20 }, size: 5 },
@ -127,7 +127,7 @@ suite('RangeMap', () => {
] ]
); );
assert.deepEqual( assert.deepStrictEqual(
consolidate([ consolidate([
{ range: { start: 0, end: 10 }, size: 1 }, { range: { start: 0, end: 10 }, size: 1 },
{ range: { start: 10, end: 20 }, size: 2 }, { range: { start: 10, end: 20 }, size: 2 },

View file

@ -354,13 +354,13 @@ suite('Splitview', () => {
assert.strictEqual(view1.size, 200); assert.strictEqual(view1.size, 200);
splitview.addView(view2, 50); splitview.addView(view2, 50);
assert.deepEqual([view1.size, view2.size], [150, 50]); assert.deepStrictEqual([view1.size, view2.size], [150, 50]);
splitview.addView(view3, Sizing.Distribute); splitview.addView(view3, Sizing.Distribute);
assert.deepEqual([view1.size, view2.size, view3.size], [66, 66, 68]); assert.deepStrictEqual([view1.size, view2.size, view3.size], [66, 66, 68]);
splitview.removeView(1, Sizing.Distribute); splitview.removeView(1, Sizing.Distribute);
assert.deepEqual([view1.size, view3.size], [100, 100]); assert.deepStrictEqual([view1.size, view3.size], [100, 100]);
splitview.dispose(); splitview.dispose();
view3.dispose(); view3.dispose();
@ -379,7 +379,7 @@ suite('Splitview', () => {
splitview.addView(view3, 25); splitview.addView(view3, 25);
splitview.layout(200); splitview.layout(200);
assert.deepEqual([view1.size, view2.size, view3.size], [67, 67, 66]); assert.deepStrictEqual([view1.size, view2.size, view3.size], [67, 67, 66]);
splitview.dispose(); splitview.dispose();
view3.dispose(); view3.dispose();
@ -398,10 +398,10 @@ suite('Splitview', () => {
assert.strictEqual(view1.size, 200); assert.strictEqual(view1.size, 200);
splitview.addView(view2, Sizing.Split(0)); splitview.addView(view2, Sizing.Split(0));
assert.deepEqual([view1.size, view2.size], [100, 100]); assert.deepStrictEqual([view1.size, view2.size], [100, 100]);
splitview.addView(view3, Sizing.Split(1)); splitview.addView(view3, Sizing.Split(1));
assert.deepEqual([view1.size, view2.size, view3.size], [100, 50, 50]); assert.deepStrictEqual([view1.size, view2.size, view3.size], [100, 50, 50]);
splitview.dispose(); splitview.dispose();
view3.dispose(); view3.dispose();
@ -420,10 +420,10 @@ suite('Splitview', () => {
assert.strictEqual(view1.size, 200); assert.strictEqual(view1.size, 200);
splitview.addView(view2, Sizing.Split(0)); splitview.addView(view2, Sizing.Split(0));
assert.deepEqual([view1.size, view2.size], [100, 100]); assert.deepStrictEqual([view1.size, view2.size], [100, 100]);
splitview.addView(view3, Sizing.Split(0)); splitview.addView(view3, Sizing.Split(0));
assert.deepEqual([view1.size, view2.size, view3.size], [50, 100, 50]); assert.deepStrictEqual([view1.size, view2.size, view3.size], [50, 100, 50]);
splitview.dispose(); splitview.dispose();
view3.dispose(); view3.dispose();
@ -439,10 +439,10 @@ suite('Splitview', () => {
splitview.addView(view1, Sizing.Distribute); splitview.addView(view1, Sizing.Distribute);
splitview.addView(view2, Sizing.Distribute); splitview.addView(view2, Sizing.Distribute);
assert.deepEqual([view1.size, view2.size], [100, 100]); assert.deepStrictEqual([view1.size, view2.size], [100, 100]);
splitview.layout(100); splitview.layout(100);
assert.deepEqual([view1.size, view2.size], [50, 50]); assert.deepStrictEqual([view1.size, view2.size], [50, 50]);
splitview.dispose(); splitview.dispose();
view2.dispose(); view2.dispose();
@ -457,10 +457,10 @@ suite('Splitview', () => {
splitview.addView(view1, Sizing.Distribute); splitview.addView(view1, Sizing.Distribute);
splitview.addView(view2, Sizing.Distribute); splitview.addView(view2, Sizing.Distribute);
assert.deepEqual([view1.size, view2.size], [100, 100]); assert.deepStrictEqual([view1.size, view2.size], [100, 100]);
splitview.layout(100); splitview.layout(100);
assert.deepEqual([view1.size, view2.size], [80, 20]); assert.deepStrictEqual([view1.size, view2.size], [80, 20]);
splitview.dispose(); splitview.dispose();
view2.dispose(); view2.dispose();
@ -477,19 +477,19 @@ suite('Splitview', () => {
splitview.addView(view1, Sizing.Distribute); splitview.addView(view1, Sizing.Distribute);
splitview.addView(view2, Sizing.Distribute); splitview.addView(view2, Sizing.Distribute);
splitview.addView(view3, Sizing.Distribute); splitview.addView(view3, Sizing.Distribute);
assert.deepEqual([view1.size, view2.size, view3.size], [66, 68, 66]); assert.deepStrictEqual([view1.size, view2.size, view3.size], [66, 68, 66]);
splitview.layout(180); splitview.layout(180);
assert.deepEqual([view1.size, view2.size, view3.size], [66, 48, 66]); assert.deepStrictEqual([view1.size, view2.size, view3.size], [66, 48, 66]);
splitview.layout(124); splitview.layout(124);
assert.deepEqual([view1.size, view2.size, view3.size], [66, 20, 38]); assert.deepStrictEqual([view1.size, view2.size, view3.size], [66, 20, 38]);
splitview.layout(60); splitview.layout(60);
assert.deepEqual([view1.size, view2.size, view3.size], [20, 20, 20]); assert.deepStrictEqual([view1.size, view2.size, view3.size], [20, 20, 20]);
splitview.layout(200); splitview.layout(200);
assert.deepEqual([view1.size, view2.size, view3.size], [20, 160, 20]); assert.deepStrictEqual([view1.size, view2.size, view3.size], [20, 160, 20]);
splitview.dispose(); splitview.dispose();
view3.dispose(); view3.dispose();
@ -507,19 +507,19 @@ suite('Splitview', () => {
splitview.addView(view1, Sizing.Distribute); splitview.addView(view1, Sizing.Distribute);
splitview.addView(view2, Sizing.Distribute); splitview.addView(view2, Sizing.Distribute);
splitview.addView(view3, Sizing.Distribute); splitview.addView(view3, Sizing.Distribute);
assert.deepEqual([view1.size, view2.size, view3.size], [66, 68, 66]); assert.deepStrictEqual([view1.size, view2.size, view3.size], [66, 68, 66]);
splitview.layout(180); splitview.layout(180);
assert.deepEqual([view1.size, view2.size, view3.size], [66, 48, 66]); assert.deepStrictEqual([view1.size, view2.size, view3.size], [66, 48, 66]);
splitview.layout(132); splitview.layout(132);
assert.deepEqual([view1.size, view2.size, view3.size], [46, 20, 66]); assert.deepStrictEqual([view1.size, view2.size, view3.size], [46, 20, 66]);
splitview.layout(60); splitview.layout(60);
assert.deepEqual([view1.size, view2.size, view3.size], [20, 20, 20]); assert.deepStrictEqual([view1.size, view2.size, view3.size], [20, 20, 20]);
splitview.layout(200); splitview.layout(200);
assert.deepEqual([view1.size, view2.size, view3.size], [20, 160, 20]); assert.deepStrictEqual([view1.size, view2.size, view3.size], [20, 160, 20]);
splitview.dispose(); splitview.dispose();
view3.dispose(); view3.dispose();
@ -539,7 +539,7 @@ suite('Splitview', () => {
splitview.addView(view3, Sizing.Distribute); splitview.addView(view3, Sizing.Distribute);
splitview.layout(200, 100); splitview.layout(200, 100);
assert.deepEqual([view1.orthogonalSize, view2.orthogonalSize, view3.orthogonalSize], [100, 100, 100]); assert.deepStrictEqual([view1.orthogonalSize, view2.orthogonalSize, view3.orthogonalSize], [100, 100, 100]);
splitview.dispose(); splitview.dispose();
view3.dispose(); view3.dispose();

View file

@ -422,7 +422,7 @@ suite('AsyncDataTree', function () {
await tree.setInput(model.root); await tree.setInput(model.root);
await tree.expand(model.get('a')); await tree.expand(model.get('a'));
assert.deepEqual(Array.from(container.querySelectorAll('.monaco-list-row')).map(e => e.textContent), ['a', 'b1']); assert.deepStrictEqual(Array.from(container.querySelectorAll('.monaco-list-row')).map(e => e.textContent), ['a', 'b1']);
const a = model.get('a'); const a = model.get('a');
const b = model.get('b'); const b = model.get('b');
@ -433,6 +433,6 @@ suite('AsyncDataTree', function () {
tree.updateChildren(b, true, true) tree.updateChildren(b, true, true)
]); ]);
assert.deepEqual(Array.from(container.querySelectorAll('.monaco-list-row')).map(e => e.textContent), ['a', 'b2']); assert.deepStrictEqual(Array.from(container.querySelectorAll('.monaco-list-row')).map(e => e.textContent), ['a', 'b2']);
}); });
}); });

View file

@ -39,8 +39,8 @@ suite('CompressedObjectTree', function () {
const compressed: IResolvedCompressedTreeElement<ICompressedTreeNode<number>> = const compressed: IResolvedCompressedTreeElement<ICompressedTreeNode<number>> =
{ element: { elements: [1], incompressible: false } }; { element: { elements: [1], incompressible: false } };
assert.deepEqual(resolve(compress(decompressed)), compressed); assert.deepStrictEqual(resolve(compress(decompressed)), compressed);
assert.deepEqual(resolve(decompress(compressed)), decompressed); assert.deepStrictEqual(resolve(decompress(compressed)), decompressed);
}); });
test('no compression', function () { test('no compression', function () {
@ -61,8 +61,8 @@ suite('CompressedObjectTree', function () {
] ]
}; };
assert.deepEqual(resolve(compress(decompressed)), compressed); assert.deepStrictEqual(resolve(compress(decompressed)), compressed);
assert.deepEqual(resolve(decompress(compressed)), decompressed); assert.deepStrictEqual(resolve(decompress(compressed)), decompressed);
}); });
test('single hierarchy', function () { test('single hierarchy', function () {
@ -84,8 +84,8 @@ suite('CompressedObjectTree', function () {
element: { elements: [1, 11, 111, 1111], incompressible: false } element: { elements: [1, 11, 111, 1111], incompressible: false }
}; };
assert.deepEqual(resolve(compress(decompressed)), compressed); assert.deepStrictEqual(resolve(compress(decompressed)), compressed);
assert.deepEqual(resolve(decompress(compressed)), decompressed); assert.deepStrictEqual(resolve(decompress(compressed)), decompressed);
}); });
test('deep compression', function () { test('deep compression', function () {
@ -116,8 +116,8 @@ suite('CompressedObjectTree', function () {
] ]
}; };
assert.deepEqual(resolve(compress(decompressed)), compressed); assert.deepStrictEqual(resolve(compress(decompressed)), compressed);
assert.deepEqual(resolve(decompress(compressed)), decompressed); assert.deepStrictEqual(resolve(decompress(compressed)), decompressed);
}); });
test('double deep compression', function () { test('double deep compression', function () {
@ -166,8 +166,8 @@ suite('CompressedObjectTree', function () {
] ]
}; };
assert.deepEqual(resolve(compress(decompressed)), compressed); assert.deepStrictEqual(resolve(compress(decompressed)), compressed);
assert.deepEqual(resolve(decompress(compressed)), decompressed); assert.deepStrictEqual(resolve(decompress(compressed)), decompressed);
}); });
test('incompressible leaf', function () { test('incompressible leaf', function () {
@ -192,8 +192,8 @@ suite('CompressedObjectTree', function () {
] ]
}; };
assert.deepEqual(resolve(compress(decompressed)), compressed); assert.deepStrictEqual(resolve(compress(decompressed)), compressed);
assert.deepEqual(resolve(decompress(compressed)), decompressed); assert.deepStrictEqual(resolve(decompress(compressed)), decompressed);
}); });
test('incompressible branch', function () { test('incompressible branch', function () {
@ -218,8 +218,8 @@ suite('CompressedObjectTree', function () {
] ]
}; };
assert.deepEqual(resolve(compress(decompressed)), compressed); assert.deepStrictEqual(resolve(compress(decompressed)), compressed);
assert.deepEqual(resolve(decompress(compressed)), decompressed); assert.deepStrictEqual(resolve(decompress(compressed)), decompressed);
}); });
test('incompressible chain', function () { test('incompressible chain', function () {
@ -249,8 +249,8 @@ suite('CompressedObjectTree', function () {
] ]
}; };
assert.deepEqual(resolve(compress(decompressed)), compressed); assert.deepStrictEqual(resolve(compress(decompressed)), compressed);
assert.deepEqual(resolve(decompress(compressed)), decompressed); assert.deepStrictEqual(resolve(decompress(compressed)), decompressed);
}); });
test('incompressible tree', function () { test('incompressible tree', function () {
@ -285,8 +285,8 @@ suite('CompressedObjectTree', function () {
] ]
}; };
assert.deepEqual(resolve(compress(decompressed)), compressed); assert.deepStrictEqual(resolve(compress(decompressed)), compressed);
assert.deepEqual(resolve(decompress(compressed)), decompressed); assert.deepStrictEqual(resolve(decompress(compressed)), decompressed);
}); });
}); });
@ -333,7 +333,7 @@ suite('CompressedObjectTree', function () {
{ element: 2 } { element: 2 }
], options); ], options);
assert.deepEqual(toArray(list), [[0], [1], [2]]); assert.deepStrictEqual(toArray(list), [[0], [1], [2]]);
assert.strictEqual(model.size, 3); assert.strictEqual(model.size, 3);
model.setChildren(null, [ model.setChildren(null, [
@ -342,11 +342,11 @@ suite('CompressedObjectTree', function () {
{ element: 5 }, { element: 5 },
], options); ], options);
assert.deepEqual(toArray(list), [[3], [4], [5]]); assert.deepStrictEqual(toArray(list), [[3], [4], [5]]);
assert.strictEqual(model.size, 3); assert.strictEqual(model.size, 3);
model.setChildren(null, [], options); model.setChildren(null, [], options);
assert.deepEqual(toArray(list), []); assert.deepStrictEqual(toArray(list), []);
assert.strictEqual(model.size, 0); assert.strictEqual(model.size, 0);
})); }));
@ -366,7 +366,7 @@ suite('CompressedObjectTree', function () {
{ element: 2 } { element: 2 }
], options); ], options);
assert.deepEqual(toArray(list), [[0], [10], [11], [12], [1], [2]]); assert.deepStrictEqual(toArray(list), [[0], [10], [11], [12], [1], [2]]);
assert.strictEqual(model.size, 6); assert.strictEqual(model.size, 6);
model.setChildren(12, [ model.setChildren(12, [
@ -374,15 +374,15 @@ suite('CompressedObjectTree', function () {
{ element: 121 } { element: 121 }
], options); ], options);
assert.deepEqual(toArray(list), [[0], [10], [11], [12], [120], [121], [1], [2]]); assert.deepStrictEqual(toArray(list), [[0], [10], [11], [12], [120], [121], [1], [2]]);
assert.strictEqual(model.size, 8); assert.strictEqual(model.size, 8);
model.setChildren(0, [], options); model.setChildren(0, [], options);
assert.deepEqual(toArray(list), [[0], [1], [2]]); assert.deepStrictEqual(toArray(list), [[0], [1], [2]]);
assert.strictEqual(model.size, 3); assert.strictEqual(model.size, 3);
model.setChildren(null, [], options); model.setChildren(null, [], options);
assert.deepEqual(toArray(list), []); assert.deepStrictEqual(toArray(list), []);
assert.strictEqual(model.size, 0); assert.strictEqual(model.size, 0);
})); }));
@ -404,7 +404,7 @@ suite('CompressedObjectTree', function () {
} }
], options); ], options);
assert.deepEqual(toArray(list), [[1, 11, 111], [1111], [1112], [1113]]); assert.deepStrictEqual(toArray(list), [[1, 11, 111], [1111], [1112], [1113]]);
assert.strictEqual(model.size, 6); assert.strictEqual(model.size, 6);
model.setChildren(11, [ model.setChildren(11, [
@ -413,21 +413,21 @@ suite('CompressedObjectTree', function () {
{ element: 113 }, { element: 113 },
], options); ], options);
assert.deepEqual(toArray(list), [[1, 11], [111], [112], [113]]); assert.deepStrictEqual(toArray(list), [[1, 11], [111], [112], [113]]);
assert.strictEqual(model.size, 5); assert.strictEqual(model.size, 5);
model.setChildren(113, [ model.setChildren(113, [
{ element: 1131 } { element: 1131 }
], options); ], options);
assert.deepEqual(toArray(list), [[1, 11], [111], [112], [113, 1131]]); assert.deepStrictEqual(toArray(list), [[1, 11], [111], [112], [113, 1131]]);
assert.strictEqual(model.size, 6); assert.strictEqual(model.size, 6);
model.setChildren(1131, [ model.setChildren(1131, [
{ element: 1132 } { element: 1132 }
], options); ], options);
assert.deepEqual(toArray(list), [[1, 11], [111], [112], [113, 1131, 1132]]); assert.deepStrictEqual(toArray(list), [[1, 11], [111], [112], [113, 1131, 1132]]);
assert.strictEqual(model.size, 7); assert.strictEqual(model.size, 7);
model.setChildren(1131, [ model.setChildren(1131, [
@ -435,7 +435,7 @@ suite('CompressedObjectTree', function () {
{ element: 1133 }, { element: 1133 },
], options); ], options);
assert.deepEqual(toArray(list), [[1, 11], [111], [112], [113, 1131], [1132], [1133]]); assert.deepStrictEqual(toArray(list), [[1, 11], [111], [112], [113, 1131], [1132], [1133]]);
assert.strictEqual(model.size, 8); assert.strictEqual(model.size, 8);
})); }));
}); });

View file

@ -106,8 +106,8 @@ suite('DataTree', function () {
assert.strictEqual(navigator.next()!.value, 2); assert.strictEqual(navigator.next()!.value, 2);
assert.strictEqual(navigator.next()!, null); assert.strictEqual(navigator.next()!, null);
assert.deepEqual(tree.getSelection(), []); assert.deepStrictEqual(tree.getSelection(), []);
assert.deepEqual(tree.getFocus(), []); assert.deepStrictEqual(tree.getFocus(), []);
}); });
test('view state can be preserved', () => { test('view state can be preserved', () => {
@ -142,7 +142,7 @@ suite('DataTree', function () {
assert.strictEqual(navigator.next()!.value, 2); assert.strictEqual(navigator.next()!.value, 2);
assert.strictEqual(navigator.next()!, null); assert.strictEqual(navigator.next()!, null);
assert.deepEqual(tree.getSelection(), [root.children![1]]); assert.deepStrictEqual(tree.getSelection(), [root.children![1]]);
assert.deepEqual(tree.getFocus(), [root.children![2]]); assert.deepStrictEqual(tree.getFocus(), [root.children![2]]);
}); });
}); });

View file

@ -55,16 +55,16 @@ suite('IndexTreeModel', () => {
{ element: 2 } { element: 2 }
], options); ], options);
assert.deepEqual(list.length, 3); assert.deepStrictEqual(list.length, 3);
assert.deepEqual(list[0].element, 0); assert.deepStrictEqual(list[0].element, 0);
assert.deepEqual(list[0].collapsed, false); assert.deepStrictEqual(list[0].collapsed, false);
assert.deepEqual(list[0].depth, 1); assert.deepStrictEqual(list[0].depth, 1);
assert.deepEqual(list[1].element, 1); assert.deepStrictEqual(list[1].element, 1);
assert.deepEqual(list[1].collapsed, false); assert.deepStrictEqual(list[1].collapsed, false);
assert.deepEqual(list[1].depth, 1); assert.deepStrictEqual(list[1].depth, 1);
assert.deepEqual(list[2].element, 2); assert.deepStrictEqual(list[2].element, 2);
assert.deepEqual(list[2].collapsed, false); assert.deepStrictEqual(list[2].collapsed, false);
assert.deepEqual(list[2].depth, 1); assert.deepStrictEqual(list[2].depth, 1);
})); }));
test('deep insert', () => withSmartSplice(options => { test('deep insert', () => withSmartSplice(options => {
@ -83,25 +83,25 @@ suite('IndexTreeModel', () => {
{ element: 2 } { element: 2 }
]); ]);
assert.deepEqual(list.length, 6); assert.deepStrictEqual(list.length, 6);
assert.deepEqual(list[0].element, 0); assert.deepStrictEqual(list[0].element, 0);
assert.deepEqual(list[0].collapsed, false); assert.deepStrictEqual(list[0].collapsed, false);
assert.deepEqual(list[0].depth, 1); assert.deepStrictEqual(list[0].depth, 1);
assert.deepEqual(list[1].element, 10); assert.deepStrictEqual(list[1].element, 10);
assert.deepEqual(list[1].collapsed, false); assert.deepStrictEqual(list[1].collapsed, false);
assert.deepEqual(list[1].depth, 2); assert.deepStrictEqual(list[1].depth, 2);
assert.deepEqual(list[2].element, 11); assert.deepStrictEqual(list[2].element, 11);
assert.deepEqual(list[2].collapsed, false); assert.deepStrictEqual(list[2].collapsed, false);
assert.deepEqual(list[2].depth, 2); assert.deepStrictEqual(list[2].depth, 2);
assert.deepEqual(list[3].element, 12); assert.deepStrictEqual(list[3].element, 12);
assert.deepEqual(list[3].collapsed, false); assert.deepStrictEqual(list[3].collapsed, false);
assert.deepEqual(list[3].depth, 2); assert.deepStrictEqual(list[3].depth, 2);
assert.deepEqual(list[4].element, 1); assert.deepStrictEqual(list[4].element, 1);
assert.deepEqual(list[4].collapsed, false); assert.deepStrictEqual(list[4].collapsed, false);
assert.deepEqual(list[4].depth, 1); assert.deepStrictEqual(list[4].depth, 1);
assert.deepEqual(list[5].element, 2); assert.deepStrictEqual(list[5].element, 2);
assert.deepEqual(list[5].collapsed, false); assert.deepStrictEqual(list[5].collapsed, false);
assert.deepEqual(list[5].depth, 1); assert.deepStrictEqual(list[5].depth, 1);
})); }));
test('deep insert collapsed', () => withSmartSplice(options => { test('deep insert collapsed', () => withSmartSplice(options => {
@ -120,16 +120,16 @@ suite('IndexTreeModel', () => {
{ element: 2 } { element: 2 }
], options); ], options);
assert.deepEqual(list.length, 3); assert.deepStrictEqual(list.length, 3);
assert.deepEqual(list[0].element, 0); assert.deepStrictEqual(list[0].element, 0);
assert.deepEqual(list[0].collapsed, true); assert.deepStrictEqual(list[0].collapsed, true);
assert.deepEqual(list[0].depth, 1); assert.deepStrictEqual(list[0].depth, 1);
assert.deepEqual(list[1].element, 1); assert.deepStrictEqual(list[1].element, 1);
assert.deepEqual(list[1].collapsed, false); assert.deepStrictEqual(list[1].collapsed, false);
assert.deepEqual(list[1].depth, 1); assert.deepStrictEqual(list[1].depth, 1);
assert.deepEqual(list[2].element, 2); assert.deepStrictEqual(list[2].element, 2);
assert.deepEqual(list[2].collapsed, false); assert.deepStrictEqual(list[2].collapsed, false);
assert.deepEqual(list[2].depth, 1); assert.deepStrictEqual(list[2].depth, 1);
})); }));
test('delete', () => withSmartSplice(options => { test('delete', () => withSmartSplice(options => {
@ -142,19 +142,19 @@ suite('IndexTreeModel', () => {
{ element: 2 } { element: 2 }
], options); ], options);
assert.deepEqual(list.length, 3); assert.deepStrictEqual(list.length, 3);
model.splice([1], 1, undefined, options); model.splice([1], 1, undefined, options);
assert.deepEqual(list.length, 2); assert.deepStrictEqual(list.length, 2);
assert.deepEqual(list[0].element, 0); assert.deepStrictEqual(list[0].element, 0);
assert.deepEqual(list[0].collapsed, false); assert.deepStrictEqual(list[0].collapsed, false);
assert.deepEqual(list[0].depth, 1); assert.deepStrictEqual(list[0].depth, 1);
assert.deepEqual(list[1].element, 2); assert.deepStrictEqual(list[1].element, 2);
assert.deepEqual(list[1].collapsed, false); assert.deepStrictEqual(list[1].collapsed, false);
assert.deepEqual(list[1].depth, 1); assert.deepStrictEqual(list[1].depth, 1);
model.splice([0], 2, undefined, options); model.splice([0], 2, undefined, options);
assert.deepEqual(list.length, 0); assert.deepStrictEqual(list.length, 0);
})); }));
test('nested delete', () => withSmartSplice(options => { test('nested delete', () => withSmartSplice(options => {
@ -173,22 +173,22 @@ suite('IndexTreeModel', () => {
{ element: 2 } { element: 2 }
], options); ], options);
assert.deepEqual(list.length, 6); assert.deepStrictEqual(list.length, 6);
model.splice([1], 2, undefined, options); model.splice([1], 2, undefined, options);
assert.deepEqual(list.length, 4); assert.deepStrictEqual(list.length, 4);
assert.deepEqual(list[0].element, 0); assert.deepStrictEqual(list[0].element, 0);
assert.deepEqual(list[0].collapsed, false); assert.deepStrictEqual(list[0].collapsed, false);
assert.deepEqual(list[0].depth, 1); assert.deepStrictEqual(list[0].depth, 1);
assert.deepEqual(list[1].element, 10); assert.deepStrictEqual(list[1].element, 10);
assert.deepEqual(list[1].collapsed, false); assert.deepStrictEqual(list[1].collapsed, false);
assert.deepEqual(list[1].depth, 2); assert.deepStrictEqual(list[1].depth, 2);
assert.deepEqual(list[2].element, 11); assert.deepStrictEqual(list[2].element, 11);
assert.deepEqual(list[2].collapsed, false); assert.deepStrictEqual(list[2].collapsed, false);
assert.deepEqual(list[2].depth, 2); assert.deepStrictEqual(list[2].depth, 2);
assert.deepEqual(list[3].element, 12); assert.deepStrictEqual(list[3].element, 12);
assert.deepEqual(list[3].collapsed, false); assert.deepStrictEqual(list[3].collapsed, false);
assert.deepEqual(list[3].depth, 2); assert.deepStrictEqual(list[3].depth, 2);
})); }));
test('deep delete', () => withSmartSplice(options => { test('deep delete', () => withSmartSplice(options => {
@ -207,16 +207,16 @@ suite('IndexTreeModel', () => {
{ element: 2 } { element: 2 }
], options); ], options);
assert.deepEqual(list.length, 6); assert.deepStrictEqual(list.length, 6);
model.splice([0], 1, undefined, options); model.splice([0], 1, undefined, options);
assert.deepEqual(list.length, 2); assert.deepStrictEqual(list.length, 2);
assert.deepEqual(list[0].element, 1); assert.deepStrictEqual(list[0].element, 1);
assert.deepEqual(list[0].collapsed, false); assert.deepStrictEqual(list[0].collapsed, false);
assert.deepEqual(list[0].depth, 1); assert.deepStrictEqual(list[0].depth, 1);
assert.deepEqual(list[1].element, 2); assert.deepStrictEqual(list[1].element, 2);
assert.deepEqual(list[1].collapsed, false); assert.deepStrictEqual(list[1].collapsed, false);
assert.deepEqual(list[1].depth, 1); assert.deepStrictEqual(list[1].depth, 1);
})); }));
test('smart splice deep', () => { test('smart splice deep', () => {
@ -269,13 +269,13 @@ suite('IndexTreeModel', () => {
{ element: 2 } { element: 2 }
], options); ], options);
assert.deepEqual(list.length, 3); assert.deepStrictEqual(list.length, 3);
model.splice([0, 1], 1, undefined, options); model.splice([0, 1], 1, undefined, options);
assert.deepEqual(list.length, 3); assert.deepStrictEqual(list.length, 3);
model.splice([0, 0], 2, undefined, options); model.splice([0, 0], 2, undefined, options);
assert.deepEqual(list.length, 3); assert.deepStrictEqual(list.length, 3);
})); }));
test('collapse', () => withSmartSplice(options => { test('collapse', () => withSmartSplice(options => {
@ -294,19 +294,19 @@ suite('IndexTreeModel', () => {
{ element: 2 } { element: 2 }
], options); ], options);
assert.deepEqual(list.length, 6); assert.deepStrictEqual(list.length, 6);
model.setCollapsed([0], true); model.setCollapsed([0], true);
assert.deepEqual(list.length, 3); assert.deepStrictEqual(list.length, 3);
assert.deepEqual(list[0].element, 0); assert.deepStrictEqual(list[0].element, 0);
assert.deepEqual(list[0].collapsed, true); assert.deepStrictEqual(list[0].collapsed, true);
assert.deepEqual(list[0].depth, 1); assert.deepStrictEqual(list[0].depth, 1);
assert.deepEqual(list[1].element, 1); assert.deepStrictEqual(list[1].element, 1);
assert.deepEqual(list[1].collapsed, false); assert.deepStrictEqual(list[1].collapsed, false);
assert.deepEqual(list[1].depth, 1); assert.deepStrictEqual(list[1].depth, 1);
assert.deepEqual(list[2].element, 2); assert.deepStrictEqual(list[2].element, 2);
assert.deepEqual(list[2].collapsed, false); assert.deepStrictEqual(list[2].collapsed, false);
assert.deepEqual(list[2].depth, 1); assert.deepStrictEqual(list[2].depth, 1);
})); }));
test('updates collapsible', () => withSmartSplice(options => { test('updates collapsible', () => withSmartSplice(options => {
@ -355,28 +355,28 @@ suite('IndexTreeModel', () => {
{ element: 2 } { element: 2 }
], options); ], options);
assert.deepEqual(list.length, 3); assert.deepStrictEqual(list.length, 3);
model.setCollapsed([0], false); model.setCollapsed([0], false);
assert.deepEqual(list.length, 6); assert.deepStrictEqual(list.length, 6);
assert.deepEqual(list[0].element, 0); assert.deepStrictEqual(list[0].element, 0);
assert.deepEqual(list[0].collapsed, false); assert.deepStrictEqual(list[0].collapsed, false);
assert.deepEqual(list[0].depth, 1); assert.deepStrictEqual(list[0].depth, 1);
assert.deepEqual(list[1].element, 10); assert.deepStrictEqual(list[1].element, 10);
assert.deepEqual(list[1].collapsed, false); assert.deepStrictEqual(list[1].collapsed, false);
assert.deepEqual(list[1].depth, 2); assert.deepStrictEqual(list[1].depth, 2);
assert.deepEqual(list[2].element, 11); assert.deepStrictEqual(list[2].element, 11);
assert.deepEqual(list[2].collapsed, false); assert.deepStrictEqual(list[2].collapsed, false);
assert.deepEqual(list[2].depth, 2); assert.deepStrictEqual(list[2].depth, 2);
assert.deepEqual(list[3].element, 12); assert.deepStrictEqual(list[3].element, 12);
assert.deepEqual(list[3].collapsed, false); assert.deepStrictEqual(list[3].collapsed, false);
assert.deepEqual(list[3].depth, 2); assert.deepStrictEqual(list[3].depth, 2);
assert.deepEqual(list[4].element, 1); assert.deepStrictEqual(list[4].element, 1);
assert.deepEqual(list[4].collapsed, false); assert.deepStrictEqual(list[4].collapsed, false);
assert.deepEqual(list[4].depth, 1); assert.deepStrictEqual(list[4].depth, 1);
assert.deepEqual(list[5].element, 2); assert.deepStrictEqual(list[5].element, 2);
assert.deepEqual(list[5].collapsed, false); assert.deepStrictEqual(list[5].collapsed, false);
assert.deepEqual(list[5].depth, 1); assert.deepStrictEqual(list[5].depth, 1);
})); }));
test('smart diff consistency', () => { test('smart diff consistency', () => {
@ -443,16 +443,16 @@ suite('IndexTreeModel', () => {
} }
]); ]);
assert.deepEqual(list.length, 5); assert.deepStrictEqual(list.length, 5);
assert.deepEqual(toArray(list), [1, 11, 111, 2, 21]); assert.deepStrictEqual(toArray(list), [1, 11, 111, 2, 21]);
model.setCollapsed([0, 0], true); model.setCollapsed([0, 0], true);
assert.deepEqual(list.length, 4); assert.deepStrictEqual(list.length, 4);
assert.deepEqual(toArray(list), [1, 11, 2, 21]); assert.deepStrictEqual(toArray(list), [1, 11, 2, 21]);
model.setCollapsed([1], true); model.setCollapsed([1], true);
assert.deepEqual(list.length, 3); assert.deepStrictEqual(list.length, 3);
assert.deepEqual(toArray(list), [1, 11, 2]); assert.deepStrictEqual(toArray(list), [1, 11, 2]);
}); });
test('setCollapsible', () => { test('setCollapsible', () => {
@ -467,55 +467,55 @@ suite('IndexTreeModel', () => {
} }
]); ]);
assert.deepEqual(list.length, 2); assert.deepStrictEqual(list.length, 2);
model.setCollapsible([0], false); model.setCollapsible([0], false);
assert.deepEqual(list.length, 2); assert.deepStrictEqual(list.length, 2);
assert.deepEqual(list[0].element, 0); assert.deepStrictEqual(list[0].element, 0);
assert.deepEqual(list[0].collapsible, false); assert.deepStrictEqual(list[0].collapsible, false);
assert.deepEqual(list[0].collapsed, false); assert.deepStrictEqual(list[0].collapsed, false);
assert.deepEqual(list[1].element, 10); assert.deepStrictEqual(list[1].element, 10);
assert.deepEqual(list[1].collapsible, false); assert.deepStrictEqual(list[1].collapsible, false);
assert.deepEqual(list[1].collapsed, false); assert.deepStrictEqual(list[1].collapsed, false);
assert.deepEqual(model.setCollapsed([0], true), false); assert.deepStrictEqual(model.setCollapsed([0], true), false);
assert.deepEqual(list[0].element, 0); assert.deepStrictEqual(list[0].element, 0);
assert.deepEqual(list[0].collapsible, false); assert.deepStrictEqual(list[0].collapsible, false);
assert.deepEqual(list[0].collapsed, false); assert.deepStrictEqual(list[0].collapsed, false);
assert.deepEqual(list[1].element, 10); assert.deepStrictEqual(list[1].element, 10);
assert.deepEqual(list[1].collapsible, false); assert.deepStrictEqual(list[1].collapsible, false);
assert.deepEqual(list[1].collapsed, false); assert.deepStrictEqual(list[1].collapsed, false);
assert.deepEqual(model.setCollapsed([0], false), false); assert.deepStrictEqual(model.setCollapsed([0], false), false);
assert.deepEqual(list[0].element, 0); assert.deepStrictEqual(list[0].element, 0);
assert.deepEqual(list[0].collapsible, false); assert.deepStrictEqual(list[0].collapsible, false);
assert.deepEqual(list[0].collapsed, false); assert.deepStrictEqual(list[0].collapsed, false);
assert.deepEqual(list[1].element, 10); assert.deepStrictEqual(list[1].element, 10);
assert.deepEqual(list[1].collapsible, false); assert.deepStrictEqual(list[1].collapsible, false);
assert.deepEqual(list[1].collapsed, false); assert.deepStrictEqual(list[1].collapsed, false);
model.setCollapsible([0], true); model.setCollapsible([0], true);
assert.deepEqual(list.length, 2); assert.deepStrictEqual(list.length, 2);
assert.deepEqual(list[0].element, 0); assert.deepStrictEqual(list[0].element, 0);
assert.deepEqual(list[0].collapsible, true); assert.deepStrictEqual(list[0].collapsible, true);
assert.deepEqual(list[0].collapsed, false); assert.deepStrictEqual(list[0].collapsed, false);
assert.deepEqual(list[1].element, 10); assert.deepStrictEqual(list[1].element, 10);
assert.deepEqual(list[1].collapsible, false); assert.deepStrictEqual(list[1].collapsible, false);
assert.deepEqual(list[1].collapsed, false); assert.deepStrictEqual(list[1].collapsed, false);
assert.deepEqual(model.setCollapsed([0], true), true); assert.deepStrictEqual(model.setCollapsed([0], true), true);
assert.deepEqual(list.length, 1); assert.deepStrictEqual(list.length, 1);
assert.deepEqual(list[0].element, 0); assert.deepStrictEqual(list[0].element, 0);
assert.deepEqual(list[0].collapsible, true); assert.deepStrictEqual(list[0].collapsible, true);
assert.deepEqual(list[0].collapsed, true); assert.deepStrictEqual(list[0].collapsed, true);
assert.deepEqual(model.setCollapsed([0], false), true); assert.deepStrictEqual(model.setCollapsed([0], false), true);
assert.deepEqual(list[0].element, 0); assert.deepStrictEqual(list[0].element, 0);
assert.deepEqual(list[0].collapsible, true); assert.deepStrictEqual(list[0].collapsible, true);
assert.deepEqual(list[0].collapsed, false); assert.deepStrictEqual(list[0].collapsed, false);
assert.deepEqual(list[1].element, 10); assert.deepStrictEqual(list[1].element, 10);
assert.deepEqual(list[1].collapsible, false); assert.deepStrictEqual(list[1].collapsible, false);
assert.deepEqual(list[1].collapsed, false); assert.deepStrictEqual(list[1].collapsed, false);
}); });
test('simple filter', () => { test('simple filter', () => {
@ -542,14 +542,14 @@ suite('IndexTreeModel', () => {
} }
]); ]);
assert.deepEqual(list.length, 4); assert.deepStrictEqual(list.length, 4);
assert.deepEqual(toArray(list), [0, 2, 4, 6]); assert.deepStrictEqual(toArray(list), [0, 2, 4, 6]);
model.setCollapsed([0], true); model.setCollapsed([0], true);
assert.deepEqual(toArray(list), [0]); assert.deepStrictEqual(toArray(list), [0]);
model.setCollapsed([0], false); model.setCollapsed([0], false);
assert.deepEqual(toArray(list), [0, 2, 4, 6]); assert.deepStrictEqual(toArray(list), [0, 2, 4, 6]);
}); });
test('recursive filter on initial model', () => { test('recursive filter on initial model', () => {
@ -571,7 +571,7 @@ suite('IndexTreeModel', () => {
} }
]); ]);
assert.deepEqual(toArray(list), []); assert.deepStrictEqual(toArray(list), []);
}); });
test('refilter', () => { test('refilter', () => {
@ -599,18 +599,18 @@ suite('IndexTreeModel', () => {
}, },
]); ]);
assert.deepEqual(toArray(list), [0, 1, 2, 3, 4, 5, 6, 7]); assert.deepStrictEqual(toArray(list), [0, 1, 2, 3, 4, 5, 6, 7]);
model.refilter(); model.refilter();
assert.deepEqual(toArray(list), [0, 1, 2, 3, 4, 5, 6, 7]); assert.deepStrictEqual(toArray(list), [0, 1, 2, 3, 4, 5, 6, 7]);
shouldFilter = true; shouldFilter = true;
model.refilter(); model.refilter();
assert.deepEqual(toArray(list), [0, 2, 4, 6]); assert.deepStrictEqual(toArray(list), [0, 2, 4, 6]);
shouldFilter = false; shouldFilter = false;
model.refilter(); model.refilter();
assert.deepEqual(toArray(list), [0, 1, 2, 3, 4, 5, 6, 7]); assert.deepStrictEqual(toArray(list), [0, 1, 2, 3, 4, 5, 6, 7]);
}); });
test('recursive filter', () => { test('recursive filter', () => {
@ -646,17 +646,17 @@ suite('IndexTreeModel', () => {
}, },
]); ]);
assert.deepEqual(list.length, 10); assert.deepStrictEqual(list.length, 10);
query = /build/; query = /build/;
model.refilter(); model.refilter();
assert.deepEqual(toArray(list), ['vscode', '.build', 'github', 'build.js', 'build']); assert.deepStrictEqual(toArray(list), ['vscode', '.build', 'github', 'build.js', 'build']);
model.setCollapsed([0], true); model.setCollapsed([0], true);
assert.deepEqual(toArray(list), ['vscode']); assert.deepStrictEqual(toArray(list), ['vscode']);
model.setCollapsed([0], false); model.setCollapsed([0], false);
assert.deepEqual(toArray(list), ['vscode', '.build', 'github', 'build.js', 'build']); assert.deepStrictEqual(toArray(list), ['vscode', '.build', 'github', 'build.js', 'build']);
}); });
test('recursive filter with collapse', () => { test('recursive filter with collapse', () => {
@ -692,17 +692,17 @@ suite('IndexTreeModel', () => {
}, },
]); ]);
assert.deepEqual(list.length, 10); assert.deepStrictEqual(list.length, 10);
query = /gulp/; query = /gulp/;
model.refilter(); model.refilter();
assert.deepEqual(toArray(list), ['vscode', 'build', 'gulpfile.js']); assert.deepStrictEqual(toArray(list), ['vscode', 'build', 'gulpfile.js']);
model.setCollapsed([0, 3], true); model.setCollapsed([0, 3], true);
assert.deepEqual(toArray(list), ['vscode', 'build']); assert.deepStrictEqual(toArray(list), ['vscode', 'build']);
model.setCollapsed([0], true); model.setCollapsed([0], true);
assert.deepEqual(toArray(list), ['vscode']); assert.deepStrictEqual(toArray(list), ['vscode']);
}); });
test('recursive filter while collapsed', () => { test('recursive filter while collapsed', () => {
@ -738,24 +738,24 @@ suite('IndexTreeModel', () => {
}, },
]); ]);
assert.deepEqual(toArray(list), ['vscode']); assert.deepStrictEqual(toArray(list), ['vscode']);
query = /gulp/; query = /gulp/;
model.refilter(); model.refilter();
assert.deepEqual(toArray(list), ['vscode']); assert.deepStrictEqual(toArray(list), ['vscode']);
model.setCollapsed([0], false); model.setCollapsed([0], false);
assert.deepEqual(toArray(list), ['vscode', 'build', 'gulpfile.js']); assert.deepStrictEqual(toArray(list), ['vscode', 'build', 'gulpfile.js']);
model.setCollapsed([0], true); model.setCollapsed([0], true);
assert.deepEqual(toArray(list), ['vscode']); assert.deepStrictEqual(toArray(list), ['vscode']);
query = new RegExp(''); query = new RegExp('');
model.refilter(); model.refilter();
assert.deepEqual(toArray(list), ['vscode']); assert.deepStrictEqual(toArray(list), ['vscode']);
model.setCollapsed([0], false); model.setCollapsed([0], false);
assert.deepEqual(list.length, 10); assert.deepStrictEqual(list.length, 10);
}); });
suite('getNodeLocation', () => { suite('getNodeLocation', () => {
@ -776,12 +776,12 @@ suite('IndexTreeModel', () => {
{ element: 2 } { element: 2 }
]); ]);
assert.deepEqual(model.getNodeLocation(list[0]), [0]); assert.deepStrictEqual(model.getNodeLocation(list[0]), [0]);
assert.deepEqual(model.getNodeLocation(list[1]), [0, 0]); assert.deepStrictEqual(model.getNodeLocation(list[1]), [0, 0]);
assert.deepEqual(model.getNodeLocation(list[2]), [0, 1]); assert.deepStrictEqual(model.getNodeLocation(list[2]), [0, 1]);
assert.deepEqual(model.getNodeLocation(list[3]), [0, 2]); assert.deepStrictEqual(model.getNodeLocation(list[3]), [0, 2]);
assert.deepEqual(model.getNodeLocation(list[4]), [1]); assert.deepStrictEqual(model.getNodeLocation(list[4]), [1]);
assert.deepEqual(model.getNodeLocation(list[5]), [2]); assert.deepStrictEqual(model.getNodeLocation(list[5]), [2]);
}); });
test('with filter', () => { test('with filter', () => {
@ -808,10 +808,10 @@ suite('IndexTreeModel', () => {
} }
]); ]);
assert.deepEqual(model.getNodeLocation(list[0]), [0]); assert.deepStrictEqual(model.getNodeLocation(list[0]), [0]);
assert.deepEqual(model.getNodeLocation(list[1]), [0, 1]); assert.deepStrictEqual(model.getNodeLocation(list[1]), [0, 1]);
assert.deepEqual(model.getNodeLocation(list[2]), [0, 3]); assert.deepStrictEqual(model.getNodeLocation(list[2]), [0, 3]);
assert.deepEqual(model.getNodeLocation(list[3]), [0, 5]); assert.deepStrictEqual(model.getNodeLocation(list[3]), [0, 5]);
}); });
}); });
@ -832,21 +832,21 @@ suite('IndexTreeModel', () => {
{ element: 'platinum' } { element: 'platinum' }
]); ]);
assert.deepEqual(toArray(list), ['silver', 'gold', 'platinum']); assert.deepStrictEqual(toArray(list), ['silver', 'gold', 'platinum']);
query = /platinum/; query = /platinum/;
model.refilter(); model.refilter();
assert.deepEqual(toArray(list), ['platinum']); assert.deepStrictEqual(toArray(list), ['platinum']);
model.splice([0], Number.POSITIVE_INFINITY, [ model.splice([0], Number.POSITIVE_INFINITY, [
{ element: 'silver' }, { element: 'silver' },
{ element: 'gold' }, { element: 'gold' },
{ element: 'platinum' } { element: 'platinum' }
]); ]);
assert.deepEqual(toArray(list), ['platinum']); assert.deepStrictEqual(toArray(list), ['platinum']);
model.refilter(); model.refilter();
assert.deepEqual(toArray(list), ['platinum']); assert.deepStrictEqual(toArray(list), ['platinum']);
}); });
test('explicit hidden nodes should have renderNodeCount == 0, issue #83211', () => { test('explicit hidden nodes should have renderNodeCount == 0, issue #83211', () => {
@ -865,18 +865,18 @@ suite('IndexTreeModel', () => {
{ element: 'b', children: [{ element: 'bb' }] } { element: 'b', children: [{ element: 'bb' }] }
]); ]);
assert.deepEqual(toArray(list), ['a', 'aa', 'b', 'bb']); assert.deepStrictEqual(toArray(list), ['a', 'aa', 'b', 'bb']);
assert.deepEqual(model.getListIndex([0]), 0); assert.deepStrictEqual(model.getListIndex([0]), 0);
assert.deepEqual(model.getListIndex([0, 0]), 1); assert.deepStrictEqual(model.getListIndex([0, 0]), 1);
assert.deepEqual(model.getListIndex([1]), 2); assert.deepStrictEqual(model.getListIndex([1]), 2);
assert.deepEqual(model.getListIndex([1, 0]), 3); assert.deepStrictEqual(model.getListIndex([1, 0]), 3);
query = /b/; query = /b/;
model.refilter(); model.refilter();
assert.deepEqual(toArray(list), ['b', 'bb']); assert.deepStrictEqual(toArray(list), ['b', 'bb']);
assert.deepEqual(model.getListIndex([0]), -1); assert.deepStrictEqual(model.getListIndex([0]), -1);
assert.deepEqual(model.getListIndex([0, 0]), -1); assert.deepStrictEqual(model.getListIndex([0, 0]), -1);
assert.deepEqual(model.getListIndex([1]), 0); assert.deepStrictEqual(model.getListIndex([1]), 0);
assert.deepEqual(model.getListIndex([1, 0]), 1); assert.deepStrictEqual(model.getListIndex([1, 0]), 1);
}); });
}); });

View file

@ -42,7 +42,7 @@ suite('ObjectTreeModel', function () {
{ element: 2 } { element: 2 }
]); ]);
assert.deepEqual(toArray(list), [0, 1, 2]); assert.deepStrictEqual(toArray(list), [0, 1, 2]);
assert.strictEqual(model.size, 3); assert.strictEqual(model.size, 3);
model.setChildren(null, [ model.setChildren(null, [
@ -51,11 +51,11 @@ suite('ObjectTreeModel', function () {
{ element: 5 }, { element: 5 },
]); ]);
assert.deepEqual(toArray(list), [3, 4, 5]); assert.deepStrictEqual(toArray(list), [3, 4, 5]);
assert.strictEqual(model.size, 3); assert.strictEqual(model.size, 3);
model.setChildren(null); model.setChildren(null);
assert.deepEqual(toArray(list), []); assert.deepStrictEqual(toArray(list), []);
assert.strictEqual(model.size, 0); assert.strictEqual(model.size, 0);
}); });
@ -75,7 +75,7 @@ suite('ObjectTreeModel', function () {
{ element: 2 } { element: 2 }
]); ]);
assert.deepEqual(toArray(list), [0, 10, 11, 12, 1, 2]); assert.deepStrictEqual(toArray(list), [0, 10, 11, 12, 1, 2]);
assert.strictEqual(model.size, 6); assert.strictEqual(model.size, 6);
model.setChildren(12, [ model.setChildren(12, [
@ -83,15 +83,15 @@ suite('ObjectTreeModel', function () {
{ element: 121 } { element: 121 }
]); ]);
assert.deepEqual(toArray(list), [0, 10, 11, 12, 120, 121, 1, 2]); assert.deepStrictEqual(toArray(list), [0, 10, 11, 12, 120, 121, 1, 2]);
assert.strictEqual(model.size, 8); assert.strictEqual(model.size, 8);
model.setChildren(0); model.setChildren(0);
assert.deepEqual(toArray(list), [0, 1, 2]); assert.deepStrictEqual(toArray(list), [0, 1, 2]);
assert.strictEqual(model.size, 3); assert.strictEqual(model.size, 3);
model.setChildren(null); model.setChildren(null);
assert.deepEqual(toArray(list), []); assert.deepStrictEqual(toArray(list), []);
assert.strictEqual(model.size, 0); assert.strictEqual(model.size, 0);
}); });
@ -103,17 +103,17 @@ suite('ObjectTreeModel', function () {
{ element: 0, collapsed: true } { element: 0, collapsed: true }
]); ]);
assert.deepEqual(toArray(list), [0]); assert.deepStrictEqual(toArray(list), [0]);
model.setChildren(0, [ model.setChildren(0, [
{ element: 1 }, { element: 1 },
{ element: 2 } { element: 2 }
]); ]);
assert.deepEqual(toArray(list), [0]); assert.deepStrictEqual(toArray(list), [0]);
model.setCollapsed(0, false); model.setCollapsed(0, false);
assert.deepEqual(toArray(list), [0, 1, 2]); assert.deepStrictEqual(toArray(list), [0, 1, 2]);
}); });
test('setChildren on expanded, unrevealed node', () => { test('setChildren on expanded, unrevealed node', () => {
@ -129,17 +129,17 @@ suite('ObjectTreeModel', function () {
{ element: 2 } { element: 2 }
]); ]);
assert.deepEqual(toArray(list), [1, 2]); assert.deepStrictEqual(toArray(list), [1, 2]);
model.setChildren(11, [ model.setChildren(11, [
{ element: 111 }, { element: 111 },
{ element: 112 } { element: 112 }
]); ]);
assert.deepEqual(toArray(list), [1, 2]); assert.deepStrictEqual(toArray(list), [1, 2]);
model.setCollapsed(1, false); model.setCollapsed(1, false);
assert.deepEqual(toArray(list), [1, 11, 111, 112, 2]); assert.deepStrictEqual(toArray(list), [1, 11, 111, 112, 2]);
}); });
test('collapse state is preserved with strict identity', () => { test('collapse state is preserved with strict identity', () => {
@ -148,26 +148,26 @@ suite('ObjectTreeModel', function () {
const data = [{ element: 'father', children: [{ element: 'child' }] }]; const data = [{ element: 'father', children: [{ element: 'child' }] }];
model.setChildren(null, data); model.setChildren(null, data);
assert.deepEqual(toArray(list), ['father']); assert.deepStrictEqual(toArray(list), ['father']);
model.setCollapsed('father', false); model.setCollapsed('father', false);
assert.deepEqual(toArray(list), ['father', 'child']); assert.deepStrictEqual(toArray(list), ['father', 'child']);
model.setChildren(null, data); model.setChildren(null, data);
assert.deepEqual(toArray(list), ['father', 'child']); assert.deepStrictEqual(toArray(list), ['father', 'child']);
const data2 = [{ element: 'father', children: [{ element: 'child' }] }, { element: 'uncle' }]; const data2 = [{ element: 'father', children: [{ element: 'child' }] }, { element: 'uncle' }];
model.setChildren(null, data2); model.setChildren(null, data2);
assert.deepEqual(toArray(list), ['father', 'child', 'uncle']); assert.deepStrictEqual(toArray(list), ['father', 'child', 'uncle']);
model.setChildren(null, [{ element: 'uncle' }]); model.setChildren(null, [{ element: 'uncle' }]);
assert.deepEqual(toArray(list), ['uncle']); assert.deepStrictEqual(toArray(list), ['uncle']);
model.setChildren(null, data2); model.setChildren(null, data2);
assert.deepEqual(toArray(list), ['father', 'uncle']); assert.deepStrictEqual(toArray(list), ['father', 'uncle']);
model.setChildren(null, data); model.setChildren(null, data);
assert.deepEqual(toArray(list), ['father']); assert.deepStrictEqual(toArray(list), ['father']);
}); });
test('sorter', () => { test('sorter', () => {
@ -182,7 +182,7 @@ suite('ObjectTreeModel', function () {
]; ];
model.setChildren(null, data); model.setChildren(null, data);
assert.deepEqual(toArray(list), ['airplanes', 'jet', 'passenger', 'bicycles', 'dutch', 'electric', 'mountain', 'cars', 'compact', 'convertible', 'sedan']); assert.deepStrictEqual(toArray(list), ['airplanes', 'jet', 'passenger', 'bicycles', 'dutch', 'electric', 'mountain', 'cars', 'compact', 'convertible', 'sedan']);
}); });
test('resort', () => { test('resort', () => {
@ -197,29 +197,29 @@ suite('ObjectTreeModel', function () {
]; ];
model.setChildren(null, data); model.setChildren(null, data);
assert.deepEqual(toArray(list), ['cars', 'sedan', 'convertible', 'compact', 'airplanes', 'passenger', 'jet', 'bicycles', 'dutch', 'mountain', 'electric']); assert.deepStrictEqual(toArray(list), ['cars', 'sedan', 'convertible', 'compact', 'airplanes', 'passenger', 'jet', 'bicycles', 'dutch', 'mountain', 'electric']);
// lexicographical // lexicographical
compare = (a, b) => a < b ? -1 : 1; compare = (a, b) => a < b ? -1 : 1;
// non-recursive // non-recursive
model.resort(null, false); model.resort(null, false);
assert.deepEqual(toArray(list), ['airplanes', 'passenger', 'jet', 'bicycles', 'dutch', 'mountain', 'electric', 'cars', 'sedan', 'convertible', 'compact']); assert.deepStrictEqual(toArray(list), ['airplanes', 'passenger', 'jet', 'bicycles', 'dutch', 'mountain', 'electric', 'cars', 'sedan', 'convertible', 'compact']);
// recursive // recursive
model.resort(); model.resort();
assert.deepEqual(toArray(list), ['airplanes', 'jet', 'passenger', 'bicycles', 'dutch', 'electric', 'mountain', 'cars', 'compact', 'convertible', 'sedan']); assert.deepStrictEqual(toArray(list), ['airplanes', 'jet', 'passenger', 'bicycles', 'dutch', 'electric', 'mountain', 'cars', 'compact', 'convertible', 'sedan']);
// reverse // reverse
compare = (a, b) => a < b ? 1 : -1; compare = (a, b) => a < b ? 1 : -1;
// scoped // scoped
model.resort('cars'); model.resort('cars');
assert.deepEqual(toArray(list), ['airplanes', 'jet', 'passenger', 'bicycles', 'dutch', 'electric', 'mountain', 'cars', 'sedan', 'convertible', 'compact']); assert.deepStrictEqual(toArray(list), ['airplanes', 'jet', 'passenger', 'bicycles', 'dutch', 'electric', 'mountain', 'cars', 'sedan', 'convertible', 'compact']);
// recursive // recursive
model.resort(); model.resort();
assert.deepEqual(toArray(list), ['cars', 'sedan', 'convertible', 'compact', 'bicycles', 'mountain', 'electric', 'dutch', 'airplanes', 'passenger', 'jet']); assert.deepStrictEqual(toArray(list), ['cars', 'sedan', 'convertible', 'compact', 'bicycles', 'mountain', 'electric', 'dutch', 'airplanes', 'passenger', 'jet']);
}); });
test('expandTo', () => { test('expandTo', () => {
@ -238,9 +238,9 @@ suite('ObjectTreeModel', function () {
{ element: 2 } { element: 2 }
]); ]);
assert.deepEqual(toArray(list), [0, 1, 2]); assert.deepStrictEqual(toArray(list), [0, 1, 2]);
model.expandTo(1000); model.expandTo(1000);
assert.deepEqual(toArray(list), [0, 10, 100, 1000, 11, 12, 1, 2]); assert.deepStrictEqual(toArray(list), [0, 10, 100, 1000, 11, 12, 1, 2]);
}); });
test('issue #95641', () => { test('issue #95641', () => {
@ -258,19 +258,19 @@ suite('ObjectTreeModel', function () {
const model = new ObjectTreeModel<string>('test', toList(list), { filter }); const model = new ObjectTreeModel<string>('test', toList(list), { filter });
model.setChildren(null, [{ element: 'file', children: [{ element: 'hello' }] }]); model.setChildren(null, [{ element: 'file', children: [{ element: 'hello' }] }]);
assert.deepEqual(toArray(list), ['file', 'hello']); assert.deepStrictEqual(toArray(list), ['file', 'hello']);
fn = (el: string) => el === 'world'; fn = (el: string) => el === 'world';
model.refilter(); model.refilter();
assert.deepEqual(toArray(list), []); assert.deepStrictEqual(toArray(list), []);
model.setChildren('file', [{ element: 'world' }]); model.setChildren('file', [{ element: 'world' }]);
assert.deepEqual(toArray(list), ['file', 'world']); assert.deepStrictEqual(toArray(list), ['file', 'world']);
model.setChildren('file', [{ element: 'hello' }]); model.setChildren('file', [{ element: 'hello' }]);
assert.deepEqual(toArray(list), []); assert.deepStrictEqual(toArray(list), []);
model.setChildren('file', [{ element: 'world' }]); model.setChildren('file', [{ element: 'world' }]);
assert.deepEqual(toArray(list), ['file', 'world']); assert.deepStrictEqual(toArray(list), ['file', 'world']);
}); });
}); });

View file

@ -20,11 +20,11 @@ suite('Color', () => {
test('getLighterColor', () => { test('getLighterColor', () => {
let color1 = new Color(new HSLA(60, 1, 0.5, 1)), color2 = new Color(new HSLA(0, 0, 0.753, 1)); let color1 = new Color(new HSLA(60, 1, 0.5, 1)), color2 = new Color(new HSLA(0, 0, 0.753, 1));
assert.deepEqual(color1.hsla, Color.getLighterColor(color1, color2).hsla); assert.deepStrictEqual(color1.hsla, Color.getLighterColor(color1, color2).hsla);
assert.deepEqual(new HSLA(0, 0, 0.916, 1), Color.getLighterColor(color2, color1).hsla); assert.deepStrictEqual(new HSLA(0, 0, 0.916, 1), Color.getLighterColor(color2, color1).hsla);
assert.deepEqual(new HSLA(0, 0, 0.851, 1), Color.getLighterColor(color2, color1, 0.3).hsla); assert.deepStrictEqual(new HSLA(0, 0, 0.851, 1), Color.getLighterColor(color2, color1, 0.3).hsla);
assert.deepEqual(new HSLA(0, 0, 0.981, 1), Color.getLighterColor(color2, color1, 0.7).hsla); assert.deepStrictEqual(new HSLA(0, 0, 0.981, 1), Color.getLighterColor(color2, color1, 0.7).hsla);
assert.deepEqual(new HSLA(0, 0, 1, 1), Color.getLighterColor(color2, color1, 1).hsla); assert.deepStrictEqual(new HSLA(0, 0, 1, 1), Color.getLighterColor(color2, color1, 1).hsla);
}); });
@ -38,164 +38,164 @@ suite('Color', () => {
test('getDarkerColor', () => { test('getDarkerColor', () => {
let color1 = new Color(new HSLA(60, 1, 0.5, 1)), color2 = new Color(new HSLA(0, 0, 0.753, 1)); let color1 = new Color(new HSLA(60, 1, 0.5, 1)), color2 = new Color(new HSLA(0, 0, 0.753, 1));
assert.deepEqual(color2.hsla, Color.getDarkerColor(color2, color1).hsla); assert.deepStrictEqual(color2.hsla, Color.getDarkerColor(color2, color1).hsla);
assert.deepEqual(new HSLA(60, 1, 0.392, 1), Color.getDarkerColor(color1, color2).hsla); assert.deepStrictEqual(new HSLA(60, 1, 0.392, 1), Color.getDarkerColor(color1, color2).hsla);
assert.deepEqual(new HSLA(60, 1, 0.435, 1), Color.getDarkerColor(color1, color2, 0.3).hsla); assert.deepStrictEqual(new HSLA(60, 1, 0.435, 1), Color.getDarkerColor(color1, color2, 0.3).hsla);
assert.deepEqual(new HSLA(60, 1, 0.349, 1), Color.getDarkerColor(color1, color2, 0.7).hsla); assert.deepStrictEqual(new HSLA(60, 1, 0.349, 1), Color.getDarkerColor(color1, color2, 0.7).hsla);
assert.deepEqual(new HSLA(60, 1, 0.284, 1), Color.getDarkerColor(color1, color2, 1).hsla); assert.deepStrictEqual(new HSLA(60, 1, 0.284, 1), Color.getDarkerColor(color1, color2, 1).hsla);
// Abyss theme // Abyss theme
assert.deepEqual(new HSLA(355, 0.874, 0.157, 1), Color.getDarkerColor(Color.fromHex('#770811'), Color.fromHex('#000c18'), 0.4).hsla); assert.deepStrictEqual(new HSLA(355, 0.874, 0.157, 1), Color.getDarkerColor(Color.fromHex('#770811'), Color.fromHex('#000c18'), 0.4).hsla);
}); });
test('luminance', () => { test('luminance', () => {
assert.deepEqual(0, new Color(new RGBA(0, 0, 0, 1)).getRelativeLuminance()); assert.deepStrictEqual(0, new Color(new RGBA(0, 0, 0, 1)).getRelativeLuminance());
assert.deepEqual(1, new Color(new RGBA(255, 255, 255, 1)).getRelativeLuminance()); assert.deepStrictEqual(1, new Color(new RGBA(255, 255, 255, 1)).getRelativeLuminance());
assert.deepEqual(0.2126, new Color(new RGBA(255, 0, 0, 1)).getRelativeLuminance()); assert.deepStrictEqual(0.2126, new Color(new RGBA(255, 0, 0, 1)).getRelativeLuminance());
assert.deepEqual(0.7152, new Color(new RGBA(0, 255, 0, 1)).getRelativeLuminance()); assert.deepStrictEqual(0.7152, new Color(new RGBA(0, 255, 0, 1)).getRelativeLuminance());
assert.deepEqual(0.0722, new Color(new RGBA(0, 0, 255, 1)).getRelativeLuminance()); assert.deepStrictEqual(0.0722, new Color(new RGBA(0, 0, 255, 1)).getRelativeLuminance());
assert.deepEqual(0.9278, new Color(new RGBA(255, 255, 0, 1)).getRelativeLuminance()); assert.deepStrictEqual(0.9278, new Color(new RGBA(255, 255, 0, 1)).getRelativeLuminance());
assert.deepEqual(0.7874, new Color(new RGBA(0, 255, 255, 1)).getRelativeLuminance()); assert.deepStrictEqual(0.7874, new Color(new RGBA(0, 255, 255, 1)).getRelativeLuminance());
assert.deepEqual(0.2848, new Color(new RGBA(255, 0, 255, 1)).getRelativeLuminance()); assert.deepStrictEqual(0.2848, new Color(new RGBA(255, 0, 255, 1)).getRelativeLuminance());
assert.deepEqual(0.5271, new Color(new RGBA(192, 192, 192, 1)).getRelativeLuminance()); assert.deepStrictEqual(0.5271, new Color(new RGBA(192, 192, 192, 1)).getRelativeLuminance());
assert.deepEqual(0.2159, new Color(new RGBA(128, 128, 128, 1)).getRelativeLuminance()); assert.deepStrictEqual(0.2159, new Color(new RGBA(128, 128, 128, 1)).getRelativeLuminance());
assert.deepEqual(0.0459, new Color(new RGBA(128, 0, 0, 1)).getRelativeLuminance()); assert.deepStrictEqual(0.0459, new Color(new RGBA(128, 0, 0, 1)).getRelativeLuminance());
assert.deepEqual(0.2003, new Color(new RGBA(128, 128, 0, 1)).getRelativeLuminance()); assert.deepStrictEqual(0.2003, new Color(new RGBA(128, 128, 0, 1)).getRelativeLuminance());
assert.deepEqual(0.1544, new Color(new RGBA(0, 128, 0, 1)).getRelativeLuminance()); assert.deepStrictEqual(0.1544, new Color(new RGBA(0, 128, 0, 1)).getRelativeLuminance());
assert.deepEqual(0.0615, new Color(new RGBA(128, 0, 128, 1)).getRelativeLuminance()); assert.deepStrictEqual(0.0615, new Color(new RGBA(128, 0, 128, 1)).getRelativeLuminance());
assert.deepEqual(0.17, new Color(new RGBA(0, 128, 128, 1)).getRelativeLuminance()); assert.deepStrictEqual(0.17, new Color(new RGBA(0, 128, 128, 1)).getRelativeLuminance());
assert.deepEqual(0.0156, new Color(new RGBA(0, 0, 128, 1)).getRelativeLuminance()); assert.deepStrictEqual(0.0156, new Color(new RGBA(0, 0, 128, 1)).getRelativeLuminance());
}); });
test('blending', () => { test('blending', () => {
assert.deepEqual(new Color(new RGBA(0, 0, 0, 0)).blend(new Color(new RGBA(243, 34, 43))), new Color(new RGBA(243, 34, 43))); assert.deepStrictEqual(new Color(new RGBA(0, 0, 0, 0)).blend(new Color(new RGBA(243, 34, 43))), new Color(new RGBA(243, 34, 43)));
assert.deepEqual(new Color(new RGBA(255, 255, 255)).blend(new Color(new RGBA(243, 34, 43))), new Color(new RGBA(255, 255, 255))); assert.deepStrictEqual(new Color(new RGBA(255, 255, 255)).blend(new Color(new RGBA(243, 34, 43))), new Color(new RGBA(255, 255, 255)));
assert.deepEqual(new Color(new RGBA(122, 122, 122, 0.7)).blend(new Color(new RGBA(243, 34, 43))), new Color(new RGBA(158, 95, 98))); assert.deepStrictEqual(new Color(new RGBA(122, 122, 122, 0.7)).blend(new Color(new RGBA(243, 34, 43))), new Color(new RGBA(158, 95, 98)));
assert.deepEqual(new Color(new RGBA(0, 0, 0, 0.58)).blend(new Color(new RGBA(255, 255, 255, 0.33))), new Color(new RGBA(49, 49, 49, 0.719))); assert.deepStrictEqual(new Color(new RGBA(0, 0, 0, 0.58)).blend(new Color(new RGBA(255, 255, 255, 0.33))), new Color(new RGBA(49, 49, 49, 0.719)));
}); });
suite('HSLA', () => { suite('HSLA', () => {
test('HSLA.toRGBA', () => { test('HSLA.toRGBA', () => {
assert.deepEqual(HSLA.toRGBA(new HSLA(0, 0, 0, 0)), new RGBA(0, 0, 0, 0)); assert.deepStrictEqual(HSLA.toRGBA(new HSLA(0, 0, 0, 0)), new RGBA(0, 0, 0, 0));
assert.deepEqual(HSLA.toRGBA(new HSLA(0, 0, 0, 1)), new RGBA(0, 0, 0, 1)); assert.deepStrictEqual(HSLA.toRGBA(new HSLA(0, 0, 0, 1)), new RGBA(0, 0, 0, 1));
assert.deepEqual(HSLA.toRGBA(new HSLA(0, 0, 1, 1)), new RGBA(255, 255, 255, 1)); assert.deepStrictEqual(HSLA.toRGBA(new HSLA(0, 0, 1, 1)), new RGBA(255, 255, 255, 1));
assert.deepEqual(HSLA.toRGBA(new HSLA(0, 1, 0.5, 1)), new RGBA(255, 0, 0, 1)); assert.deepStrictEqual(HSLA.toRGBA(new HSLA(0, 1, 0.5, 1)), new RGBA(255, 0, 0, 1));
assert.deepEqual(HSLA.toRGBA(new HSLA(120, 1, 0.5, 1)), new RGBA(0, 255, 0, 1)); assert.deepStrictEqual(HSLA.toRGBA(new HSLA(120, 1, 0.5, 1)), new RGBA(0, 255, 0, 1));
assert.deepEqual(HSLA.toRGBA(new HSLA(240, 1, 0.5, 1)), new RGBA(0, 0, 255, 1)); assert.deepStrictEqual(HSLA.toRGBA(new HSLA(240, 1, 0.5, 1)), new RGBA(0, 0, 255, 1));
assert.deepEqual(HSLA.toRGBA(new HSLA(60, 1, 0.5, 1)), new RGBA(255, 255, 0, 1)); assert.deepStrictEqual(HSLA.toRGBA(new HSLA(60, 1, 0.5, 1)), new RGBA(255, 255, 0, 1));
assert.deepEqual(HSLA.toRGBA(new HSLA(180, 1, 0.5, 1)), new RGBA(0, 255, 255, 1)); assert.deepStrictEqual(HSLA.toRGBA(new HSLA(180, 1, 0.5, 1)), new RGBA(0, 255, 255, 1));
assert.deepEqual(HSLA.toRGBA(new HSLA(300, 1, 0.5, 1)), new RGBA(255, 0, 255, 1)); assert.deepStrictEqual(HSLA.toRGBA(new HSLA(300, 1, 0.5, 1)), new RGBA(255, 0, 255, 1));
assert.deepEqual(HSLA.toRGBA(new HSLA(0, 0, 0.753, 1)), new RGBA(192, 192, 192, 1)); assert.deepStrictEqual(HSLA.toRGBA(new HSLA(0, 0, 0.753, 1)), new RGBA(192, 192, 192, 1));
assert.deepEqual(HSLA.toRGBA(new HSLA(0, 0, 0.502, 1)), new RGBA(128, 128, 128, 1)); assert.deepStrictEqual(HSLA.toRGBA(new HSLA(0, 0, 0.502, 1)), new RGBA(128, 128, 128, 1));
assert.deepEqual(HSLA.toRGBA(new HSLA(0, 1, 0.251, 1)), new RGBA(128, 0, 0, 1)); assert.deepStrictEqual(HSLA.toRGBA(new HSLA(0, 1, 0.251, 1)), new RGBA(128, 0, 0, 1));
assert.deepEqual(HSLA.toRGBA(new HSLA(60, 1, 0.251, 1)), new RGBA(128, 128, 0, 1)); assert.deepStrictEqual(HSLA.toRGBA(new HSLA(60, 1, 0.251, 1)), new RGBA(128, 128, 0, 1));
assert.deepEqual(HSLA.toRGBA(new HSLA(120, 1, 0.251, 1)), new RGBA(0, 128, 0, 1)); assert.deepStrictEqual(HSLA.toRGBA(new HSLA(120, 1, 0.251, 1)), new RGBA(0, 128, 0, 1));
assert.deepEqual(HSLA.toRGBA(new HSLA(300, 1, 0.251, 1)), new RGBA(128, 0, 128, 1)); assert.deepStrictEqual(HSLA.toRGBA(new HSLA(300, 1, 0.251, 1)), new RGBA(128, 0, 128, 1));
assert.deepEqual(HSLA.toRGBA(new HSLA(180, 1, 0.251, 1)), new RGBA(0, 128, 128, 1)); assert.deepStrictEqual(HSLA.toRGBA(new HSLA(180, 1, 0.251, 1)), new RGBA(0, 128, 128, 1));
assert.deepEqual(HSLA.toRGBA(new HSLA(240, 1, 0.251, 1)), new RGBA(0, 0, 128, 1)); assert.deepStrictEqual(HSLA.toRGBA(new HSLA(240, 1, 0.251, 1)), new RGBA(0, 0, 128, 1));
}); });
test('HSLA.fromRGBA', () => { test('HSLA.fromRGBA', () => {
assert.deepEqual(HSLA.fromRGBA(new RGBA(0, 0, 0, 0)), new HSLA(0, 0, 0, 0)); assert.deepStrictEqual(HSLA.fromRGBA(new RGBA(0, 0, 0, 0)), new HSLA(0, 0, 0, 0));
assert.deepEqual(HSLA.fromRGBA(new RGBA(0, 0, 0, 1)), new HSLA(0, 0, 0, 1)); assert.deepStrictEqual(HSLA.fromRGBA(new RGBA(0, 0, 0, 1)), new HSLA(0, 0, 0, 1));
assert.deepEqual(HSLA.fromRGBA(new RGBA(255, 255, 255, 1)), new HSLA(0, 0, 1, 1)); assert.deepStrictEqual(HSLA.fromRGBA(new RGBA(255, 255, 255, 1)), new HSLA(0, 0, 1, 1));
assert.deepEqual(HSLA.fromRGBA(new RGBA(255, 0, 0, 1)), new HSLA(0, 1, 0.5, 1)); assert.deepStrictEqual(HSLA.fromRGBA(new RGBA(255, 0, 0, 1)), new HSLA(0, 1, 0.5, 1));
assert.deepEqual(HSLA.fromRGBA(new RGBA(0, 255, 0, 1)), new HSLA(120, 1, 0.5, 1)); assert.deepStrictEqual(HSLA.fromRGBA(new RGBA(0, 255, 0, 1)), new HSLA(120, 1, 0.5, 1));
assert.deepEqual(HSLA.fromRGBA(new RGBA(0, 0, 255, 1)), new HSLA(240, 1, 0.5, 1)); assert.deepStrictEqual(HSLA.fromRGBA(new RGBA(0, 0, 255, 1)), new HSLA(240, 1, 0.5, 1));
assert.deepEqual(HSLA.fromRGBA(new RGBA(255, 255, 0, 1)), new HSLA(60, 1, 0.5, 1)); assert.deepStrictEqual(HSLA.fromRGBA(new RGBA(255, 255, 0, 1)), new HSLA(60, 1, 0.5, 1));
assert.deepEqual(HSLA.fromRGBA(new RGBA(0, 255, 255, 1)), new HSLA(180, 1, 0.5, 1)); assert.deepStrictEqual(HSLA.fromRGBA(new RGBA(0, 255, 255, 1)), new HSLA(180, 1, 0.5, 1));
assert.deepEqual(HSLA.fromRGBA(new RGBA(255, 0, 255, 1)), new HSLA(300, 1, 0.5, 1)); assert.deepStrictEqual(HSLA.fromRGBA(new RGBA(255, 0, 255, 1)), new HSLA(300, 1, 0.5, 1));
assert.deepEqual(HSLA.fromRGBA(new RGBA(192, 192, 192, 1)), new HSLA(0, 0, 0.753, 1)); assert.deepStrictEqual(HSLA.fromRGBA(new RGBA(192, 192, 192, 1)), new HSLA(0, 0, 0.753, 1));
assert.deepEqual(HSLA.fromRGBA(new RGBA(128, 128, 128, 1)), new HSLA(0, 0, 0.502, 1)); assert.deepStrictEqual(HSLA.fromRGBA(new RGBA(128, 128, 128, 1)), new HSLA(0, 0, 0.502, 1));
assert.deepEqual(HSLA.fromRGBA(new RGBA(128, 0, 0, 1)), new HSLA(0, 1, 0.251, 1)); assert.deepStrictEqual(HSLA.fromRGBA(new RGBA(128, 0, 0, 1)), new HSLA(0, 1, 0.251, 1));
assert.deepEqual(HSLA.fromRGBA(new RGBA(128, 128, 0, 1)), new HSLA(60, 1, 0.251, 1)); assert.deepStrictEqual(HSLA.fromRGBA(new RGBA(128, 128, 0, 1)), new HSLA(60, 1, 0.251, 1));
assert.deepEqual(HSLA.fromRGBA(new RGBA(0, 128, 0, 1)), new HSLA(120, 1, 0.251, 1)); assert.deepStrictEqual(HSLA.fromRGBA(new RGBA(0, 128, 0, 1)), new HSLA(120, 1, 0.251, 1));
assert.deepEqual(HSLA.fromRGBA(new RGBA(128, 0, 128, 1)), new HSLA(300, 1, 0.251, 1)); assert.deepStrictEqual(HSLA.fromRGBA(new RGBA(128, 0, 128, 1)), new HSLA(300, 1, 0.251, 1));
assert.deepEqual(HSLA.fromRGBA(new RGBA(0, 128, 128, 1)), new HSLA(180, 1, 0.251, 1)); assert.deepStrictEqual(HSLA.fromRGBA(new RGBA(0, 128, 128, 1)), new HSLA(180, 1, 0.251, 1));
assert.deepEqual(HSLA.fromRGBA(new RGBA(0, 0, 128, 1)), new HSLA(240, 1, 0.251, 1)); assert.deepStrictEqual(HSLA.fromRGBA(new RGBA(0, 0, 128, 1)), new HSLA(240, 1, 0.251, 1));
}); });
}); });
suite('HSVA', () => { suite('HSVA', () => {
test('HSVA.toRGBA', () => { test('HSVA.toRGBA', () => {
assert.deepEqual(HSVA.toRGBA(new HSVA(0, 0, 0, 0)), new RGBA(0, 0, 0, 0)); assert.deepStrictEqual(HSVA.toRGBA(new HSVA(0, 0, 0, 0)), new RGBA(0, 0, 0, 0));
assert.deepEqual(HSVA.toRGBA(new HSVA(0, 0, 0, 1)), new RGBA(0, 0, 0, 1)); assert.deepStrictEqual(HSVA.toRGBA(new HSVA(0, 0, 0, 1)), new RGBA(0, 0, 0, 1));
assert.deepEqual(HSVA.toRGBA(new HSVA(0, 0, 1, 1)), new RGBA(255, 255, 255, 1)); assert.deepStrictEqual(HSVA.toRGBA(new HSVA(0, 0, 1, 1)), new RGBA(255, 255, 255, 1));
assert.deepEqual(HSVA.toRGBA(new HSVA(0, 1, 1, 1)), new RGBA(255, 0, 0, 1)); assert.deepStrictEqual(HSVA.toRGBA(new HSVA(0, 1, 1, 1)), new RGBA(255, 0, 0, 1));
assert.deepEqual(HSVA.toRGBA(new HSVA(120, 1, 1, 1)), new RGBA(0, 255, 0, 1)); assert.deepStrictEqual(HSVA.toRGBA(new HSVA(120, 1, 1, 1)), new RGBA(0, 255, 0, 1));
assert.deepEqual(HSVA.toRGBA(new HSVA(240, 1, 1, 1)), new RGBA(0, 0, 255, 1)); assert.deepStrictEqual(HSVA.toRGBA(new HSVA(240, 1, 1, 1)), new RGBA(0, 0, 255, 1));
assert.deepEqual(HSVA.toRGBA(new HSVA(60, 1, 1, 1)), new RGBA(255, 255, 0, 1)); assert.deepStrictEqual(HSVA.toRGBA(new HSVA(60, 1, 1, 1)), new RGBA(255, 255, 0, 1));
assert.deepEqual(HSVA.toRGBA(new HSVA(180, 1, 1, 1)), new RGBA(0, 255, 255, 1)); assert.deepStrictEqual(HSVA.toRGBA(new HSVA(180, 1, 1, 1)), new RGBA(0, 255, 255, 1));
assert.deepEqual(HSVA.toRGBA(new HSVA(300, 1, 1, 1)), new RGBA(255, 0, 255, 1)); assert.deepStrictEqual(HSVA.toRGBA(new HSVA(300, 1, 1, 1)), new RGBA(255, 0, 255, 1));
assert.deepEqual(HSVA.toRGBA(new HSVA(0, 0, 0.753, 1)), new RGBA(192, 192, 192, 1)); assert.deepStrictEqual(HSVA.toRGBA(new HSVA(0, 0, 0.753, 1)), new RGBA(192, 192, 192, 1));
assert.deepEqual(HSVA.toRGBA(new HSVA(0, 0, 0.502, 1)), new RGBA(128, 128, 128, 1)); assert.deepStrictEqual(HSVA.toRGBA(new HSVA(0, 0, 0.502, 1)), new RGBA(128, 128, 128, 1));
assert.deepEqual(HSVA.toRGBA(new HSVA(0, 1, 0.502, 1)), new RGBA(128, 0, 0, 1)); assert.deepStrictEqual(HSVA.toRGBA(new HSVA(0, 1, 0.502, 1)), new RGBA(128, 0, 0, 1));
assert.deepEqual(HSVA.toRGBA(new HSVA(60, 1, 0.502, 1)), new RGBA(128, 128, 0, 1)); assert.deepStrictEqual(HSVA.toRGBA(new HSVA(60, 1, 0.502, 1)), new RGBA(128, 128, 0, 1));
assert.deepEqual(HSVA.toRGBA(new HSVA(120, 1, 0.502, 1)), new RGBA(0, 128, 0, 1)); assert.deepStrictEqual(HSVA.toRGBA(new HSVA(120, 1, 0.502, 1)), new RGBA(0, 128, 0, 1));
assert.deepEqual(HSVA.toRGBA(new HSVA(300, 1, 0.502, 1)), new RGBA(128, 0, 128, 1)); assert.deepStrictEqual(HSVA.toRGBA(new HSVA(300, 1, 0.502, 1)), new RGBA(128, 0, 128, 1));
assert.deepEqual(HSVA.toRGBA(new HSVA(180, 1, 0.502, 1)), new RGBA(0, 128, 128, 1)); assert.deepStrictEqual(HSVA.toRGBA(new HSVA(180, 1, 0.502, 1)), new RGBA(0, 128, 128, 1));
assert.deepEqual(HSVA.toRGBA(new HSVA(240, 1, 0.502, 1)), new RGBA(0, 0, 128, 1)); assert.deepStrictEqual(HSVA.toRGBA(new HSVA(240, 1, 0.502, 1)), new RGBA(0, 0, 128, 1));
assert.deepEqual(HSVA.toRGBA(new HSVA(360, 0, 0, 0)), new RGBA(0, 0, 0, 0)); assert.deepStrictEqual(HSVA.toRGBA(new HSVA(360, 0, 0, 0)), new RGBA(0, 0, 0, 0));
assert.deepEqual(HSVA.toRGBA(new HSVA(360, 0, 0, 1)), new RGBA(0, 0, 0, 1)); assert.deepStrictEqual(HSVA.toRGBA(new HSVA(360, 0, 0, 1)), new RGBA(0, 0, 0, 1));
assert.deepEqual(HSVA.toRGBA(new HSVA(360, 0, 1, 1)), new RGBA(255, 255, 255, 1)); assert.deepStrictEqual(HSVA.toRGBA(new HSVA(360, 0, 1, 1)), new RGBA(255, 255, 255, 1));
assert.deepEqual(HSVA.toRGBA(new HSVA(360, 1, 1, 1)), new RGBA(255, 0, 0, 1)); assert.deepStrictEqual(HSVA.toRGBA(new HSVA(360, 1, 1, 1)), new RGBA(255, 0, 0, 1));
assert.deepEqual(HSVA.toRGBA(new HSVA(360, 0, 0.753, 1)), new RGBA(192, 192, 192, 1)); assert.deepStrictEqual(HSVA.toRGBA(new HSVA(360, 0, 0.753, 1)), new RGBA(192, 192, 192, 1));
assert.deepEqual(HSVA.toRGBA(new HSVA(360, 0, 0.502, 1)), new RGBA(128, 128, 128, 1)); assert.deepStrictEqual(HSVA.toRGBA(new HSVA(360, 0, 0.502, 1)), new RGBA(128, 128, 128, 1));
assert.deepEqual(HSVA.toRGBA(new HSVA(360, 1, 0.502, 1)), new RGBA(128, 0, 0, 1)); assert.deepStrictEqual(HSVA.toRGBA(new HSVA(360, 1, 0.502, 1)), new RGBA(128, 0, 0, 1));
}); });
test('HSVA.fromRGBA', () => { test('HSVA.fromRGBA', () => {
assert.deepEqual(HSVA.fromRGBA(new RGBA(0, 0, 0, 0)), new HSVA(0, 0, 0, 0)); assert.deepStrictEqual(HSVA.fromRGBA(new RGBA(0, 0, 0, 0)), new HSVA(0, 0, 0, 0));
assert.deepEqual(HSVA.fromRGBA(new RGBA(0, 0, 0, 1)), new HSVA(0, 0, 0, 1)); assert.deepStrictEqual(HSVA.fromRGBA(new RGBA(0, 0, 0, 1)), new HSVA(0, 0, 0, 1));
assert.deepEqual(HSVA.fromRGBA(new RGBA(255, 255, 255, 1)), new HSVA(0, 0, 1, 1)); assert.deepStrictEqual(HSVA.fromRGBA(new RGBA(255, 255, 255, 1)), new HSVA(0, 0, 1, 1));
assert.deepEqual(HSVA.fromRGBA(new RGBA(255, 0, 0, 1)), new HSVA(0, 1, 1, 1)); assert.deepStrictEqual(HSVA.fromRGBA(new RGBA(255, 0, 0, 1)), new HSVA(0, 1, 1, 1));
assert.deepEqual(HSVA.fromRGBA(new RGBA(0, 255, 0, 1)), new HSVA(120, 1, 1, 1)); assert.deepStrictEqual(HSVA.fromRGBA(new RGBA(0, 255, 0, 1)), new HSVA(120, 1, 1, 1));
assert.deepEqual(HSVA.fromRGBA(new RGBA(0, 0, 255, 1)), new HSVA(240, 1, 1, 1)); assert.deepStrictEqual(HSVA.fromRGBA(new RGBA(0, 0, 255, 1)), new HSVA(240, 1, 1, 1));
assert.deepEqual(HSVA.fromRGBA(new RGBA(255, 255, 0, 1)), new HSVA(60, 1, 1, 1)); assert.deepStrictEqual(HSVA.fromRGBA(new RGBA(255, 255, 0, 1)), new HSVA(60, 1, 1, 1));
assert.deepEqual(HSVA.fromRGBA(new RGBA(0, 255, 255, 1)), new HSVA(180, 1, 1, 1)); assert.deepStrictEqual(HSVA.fromRGBA(new RGBA(0, 255, 255, 1)), new HSVA(180, 1, 1, 1));
assert.deepEqual(HSVA.fromRGBA(new RGBA(255, 0, 255, 1)), new HSVA(300, 1, 1, 1)); assert.deepStrictEqual(HSVA.fromRGBA(new RGBA(255, 0, 255, 1)), new HSVA(300, 1, 1, 1));
assert.deepEqual(HSVA.fromRGBA(new RGBA(192, 192, 192, 1)), new HSVA(0, 0, 0.753, 1)); assert.deepStrictEqual(HSVA.fromRGBA(new RGBA(192, 192, 192, 1)), new HSVA(0, 0, 0.753, 1));
assert.deepEqual(HSVA.fromRGBA(new RGBA(128, 128, 128, 1)), new HSVA(0, 0, 0.502, 1)); assert.deepStrictEqual(HSVA.fromRGBA(new RGBA(128, 128, 128, 1)), new HSVA(0, 0, 0.502, 1));
assert.deepEqual(HSVA.fromRGBA(new RGBA(128, 0, 0, 1)), new HSVA(0, 1, 0.502, 1)); assert.deepStrictEqual(HSVA.fromRGBA(new RGBA(128, 0, 0, 1)), new HSVA(0, 1, 0.502, 1));
assert.deepEqual(HSVA.fromRGBA(new RGBA(128, 128, 0, 1)), new HSVA(60, 1, 0.502, 1)); assert.deepStrictEqual(HSVA.fromRGBA(new RGBA(128, 128, 0, 1)), new HSVA(60, 1, 0.502, 1));
assert.deepEqual(HSVA.fromRGBA(new RGBA(0, 128, 0, 1)), new HSVA(120, 1, 0.502, 1)); assert.deepStrictEqual(HSVA.fromRGBA(new RGBA(0, 128, 0, 1)), new HSVA(120, 1, 0.502, 1));
assert.deepEqual(HSVA.fromRGBA(new RGBA(128, 0, 128, 1)), new HSVA(300, 1, 0.502, 1)); assert.deepStrictEqual(HSVA.fromRGBA(new RGBA(128, 0, 128, 1)), new HSVA(300, 1, 0.502, 1));
assert.deepEqual(HSVA.fromRGBA(new RGBA(0, 128, 128, 1)), new HSVA(180, 1, 0.502, 1)); assert.deepStrictEqual(HSVA.fromRGBA(new RGBA(0, 128, 128, 1)), new HSVA(180, 1, 0.502, 1));
assert.deepEqual(HSVA.fromRGBA(new RGBA(0, 0, 128, 1)), new HSVA(240, 1, 0.502, 1)); assert.deepStrictEqual(HSVA.fromRGBA(new RGBA(0, 0, 128, 1)), new HSVA(240, 1, 0.502, 1));
}); });
test('Keep hue value when saturation is 0', () => { test('Keep hue value when saturation is 0', () => {
assert.deepEqual(HSVA.toRGBA(new HSVA(10, 0, 0, 0)), HSVA.toRGBA(new HSVA(20, 0, 0, 0))); assert.deepStrictEqual(HSVA.toRGBA(new HSVA(10, 0, 0, 0)), HSVA.toRGBA(new HSVA(20, 0, 0, 0)));
assert.deepEqual(new Color(new HSVA(10, 0, 0, 0)).rgba, new Color(new HSVA(20, 0, 0, 0)).rgba); assert.deepStrictEqual(new Color(new HSVA(10, 0, 0, 0)).rgba, new Color(new HSVA(20, 0, 0, 0)).rgba);
assert.notDeepEqual(new Color(new HSVA(10, 0, 0, 0)).hsva, new Color(new HSVA(20, 0, 0, 0)).hsva); assert.notDeepEqual(new Color(new HSVA(10, 0, 0, 0)).hsva, new Color(new HSVA(20, 0, 0, 0)).hsva);
}); });
test('bug#36240', () => { test('bug#36240', () => {
assert.deepEqual(HSVA.fromRGBA(new RGBA(92, 106, 196, 1)), new HSVA(232, 0.531, 0.769, 1)); assert.deepStrictEqual(HSVA.fromRGBA(new RGBA(92, 106, 196, 1)), new HSVA(232, 0.531, 0.769, 1));
assert.deepEqual(HSVA.toRGBA(HSVA.fromRGBA(new RGBA(92, 106, 196, 1))), new RGBA(92, 106, 196, 1)); assert.deepStrictEqual(HSVA.toRGBA(HSVA.fromRGBA(new RGBA(92, 106, 196, 1))), new RGBA(92, 106, 196, 1));
}); });
}); });
@ -204,49 +204,49 @@ suite('Color', () => {
test('parseHex', () => { test('parseHex', () => {
// invalid // invalid
assert.deepEqual(Color.Format.CSS.parseHex(''), null); assert.deepStrictEqual(Color.Format.CSS.parseHex(''), null);
assert.deepEqual(Color.Format.CSS.parseHex('#'), null); assert.deepStrictEqual(Color.Format.CSS.parseHex('#'), null);
assert.deepEqual(Color.Format.CSS.parseHex('#0102030'), null); assert.deepStrictEqual(Color.Format.CSS.parseHex('#0102030'), null);
// somewhat valid // somewhat valid
assert.deepEqual(Color.Format.CSS.parseHex('#FFFFG0')!.rgba, new RGBA(255, 255, 0, 1)); assert.deepStrictEqual(Color.Format.CSS.parseHex('#FFFFG0')!.rgba, new RGBA(255, 255, 0, 1));
assert.deepEqual(Color.Format.CSS.parseHex('#FFFFg0')!.rgba, new RGBA(255, 255, 0, 1)); assert.deepStrictEqual(Color.Format.CSS.parseHex('#FFFFg0')!.rgba, new RGBA(255, 255, 0, 1));
assert.deepEqual(Color.Format.CSS.parseHex('#-FFF00')!.rgba, new RGBA(15, 255, 0, 1)); assert.deepStrictEqual(Color.Format.CSS.parseHex('#-FFF00')!.rgba, new RGBA(15, 255, 0, 1));
// valid // valid
assert.deepEqual(Color.Format.CSS.parseHex('#000000')!.rgba, new RGBA(0, 0, 0, 1)); assert.deepStrictEqual(Color.Format.CSS.parseHex('#000000')!.rgba, new RGBA(0, 0, 0, 1));
assert.deepEqual(Color.Format.CSS.parseHex('#FFFFFF')!.rgba, new RGBA(255, 255, 255, 1)); assert.deepStrictEqual(Color.Format.CSS.parseHex('#FFFFFF')!.rgba, new RGBA(255, 255, 255, 1));
assert.deepEqual(Color.Format.CSS.parseHex('#FF0000')!.rgba, new RGBA(255, 0, 0, 1)); assert.deepStrictEqual(Color.Format.CSS.parseHex('#FF0000')!.rgba, new RGBA(255, 0, 0, 1));
assert.deepEqual(Color.Format.CSS.parseHex('#00FF00')!.rgba, new RGBA(0, 255, 0, 1)); assert.deepStrictEqual(Color.Format.CSS.parseHex('#00FF00')!.rgba, new RGBA(0, 255, 0, 1));
assert.deepEqual(Color.Format.CSS.parseHex('#0000FF')!.rgba, new RGBA(0, 0, 255, 1)); assert.deepStrictEqual(Color.Format.CSS.parseHex('#0000FF')!.rgba, new RGBA(0, 0, 255, 1));
assert.deepEqual(Color.Format.CSS.parseHex('#FFFF00')!.rgba, new RGBA(255, 255, 0, 1)); assert.deepStrictEqual(Color.Format.CSS.parseHex('#FFFF00')!.rgba, new RGBA(255, 255, 0, 1));
assert.deepEqual(Color.Format.CSS.parseHex('#00FFFF')!.rgba, new RGBA(0, 255, 255, 1)); assert.deepStrictEqual(Color.Format.CSS.parseHex('#00FFFF')!.rgba, new RGBA(0, 255, 255, 1));
assert.deepEqual(Color.Format.CSS.parseHex('#FF00FF')!.rgba, new RGBA(255, 0, 255, 1)); assert.deepStrictEqual(Color.Format.CSS.parseHex('#FF00FF')!.rgba, new RGBA(255, 0, 255, 1));
assert.deepEqual(Color.Format.CSS.parseHex('#C0C0C0')!.rgba, new RGBA(192, 192, 192, 1)); assert.deepStrictEqual(Color.Format.CSS.parseHex('#C0C0C0')!.rgba, new RGBA(192, 192, 192, 1));
assert.deepEqual(Color.Format.CSS.parseHex('#808080')!.rgba, new RGBA(128, 128, 128, 1)); assert.deepStrictEqual(Color.Format.CSS.parseHex('#808080')!.rgba, new RGBA(128, 128, 128, 1));
assert.deepEqual(Color.Format.CSS.parseHex('#800000')!.rgba, new RGBA(128, 0, 0, 1)); assert.deepStrictEqual(Color.Format.CSS.parseHex('#800000')!.rgba, new RGBA(128, 0, 0, 1));
assert.deepEqual(Color.Format.CSS.parseHex('#808000')!.rgba, new RGBA(128, 128, 0, 1)); assert.deepStrictEqual(Color.Format.CSS.parseHex('#808000')!.rgba, new RGBA(128, 128, 0, 1));
assert.deepEqual(Color.Format.CSS.parseHex('#008000')!.rgba, new RGBA(0, 128, 0, 1)); assert.deepStrictEqual(Color.Format.CSS.parseHex('#008000')!.rgba, new RGBA(0, 128, 0, 1));
assert.deepEqual(Color.Format.CSS.parseHex('#800080')!.rgba, new RGBA(128, 0, 128, 1)); assert.deepStrictEqual(Color.Format.CSS.parseHex('#800080')!.rgba, new RGBA(128, 0, 128, 1));
assert.deepEqual(Color.Format.CSS.parseHex('#008080')!.rgba, new RGBA(0, 128, 128, 1)); assert.deepStrictEqual(Color.Format.CSS.parseHex('#008080')!.rgba, new RGBA(0, 128, 128, 1));
assert.deepEqual(Color.Format.CSS.parseHex('#000080')!.rgba, new RGBA(0, 0, 128, 1)); assert.deepStrictEqual(Color.Format.CSS.parseHex('#000080')!.rgba, new RGBA(0, 0, 128, 1));
assert.deepEqual(Color.Format.CSS.parseHex('#010203')!.rgba, new RGBA(1, 2, 3, 1)); assert.deepStrictEqual(Color.Format.CSS.parseHex('#010203')!.rgba, new RGBA(1, 2, 3, 1));
assert.deepEqual(Color.Format.CSS.parseHex('#040506')!.rgba, new RGBA(4, 5, 6, 1)); assert.deepStrictEqual(Color.Format.CSS.parseHex('#040506')!.rgba, new RGBA(4, 5, 6, 1));
assert.deepEqual(Color.Format.CSS.parseHex('#070809')!.rgba, new RGBA(7, 8, 9, 1)); assert.deepStrictEqual(Color.Format.CSS.parseHex('#070809')!.rgba, new RGBA(7, 8, 9, 1));
assert.deepEqual(Color.Format.CSS.parseHex('#0a0A0a')!.rgba, new RGBA(10, 10, 10, 1)); assert.deepStrictEqual(Color.Format.CSS.parseHex('#0a0A0a')!.rgba, new RGBA(10, 10, 10, 1));
assert.deepEqual(Color.Format.CSS.parseHex('#0b0B0b')!.rgba, new RGBA(11, 11, 11, 1)); assert.deepStrictEqual(Color.Format.CSS.parseHex('#0b0B0b')!.rgba, new RGBA(11, 11, 11, 1));
assert.deepEqual(Color.Format.CSS.parseHex('#0c0C0c')!.rgba, new RGBA(12, 12, 12, 1)); assert.deepStrictEqual(Color.Format.CSS.parseHex('#0c0C0c')!.rgba, new RGBA(12, 12, 12, 1));
assert.deepEqual(Color.Format.CSS.parseHex('#0d0D0d')!.rgba, new RGBA(13, 13, 13, 1)); assert.deepStrictEqual(Color.Format.CSS.parseHex('#0d0D0d')!.rgba, new RGBA(13, 13, 13, 1));
assert.deepEqual(Color.Format.CSS.parseHex('#0e0E0e')!.rgba, new RGBA(14, 14, 14, 1)); assert.deepStrictEqual(Color.Format.CSS.parseHex('#0e0E0e')!.rgba, new RGBA(14, 14, 14, 1));
assert.deepEqual(Color.Format.CSS.parseHex('#0f0F0f')!.rgba, new RGBA(15, 15, 15, 1)); assert.deepStrictEqual(Color.Format.CSS.parseHex('#0f0F0f')!.rgba, new RGBA(15, 15, 15, 1));
assert.deepEqual(Color.Format.CSS.parseHex('#a0A0a0')!.rgba, new RGBA(160, 160, 160, 1)); assert.deepStrictEqual(Color.Format.CSS.parseHex('#a0A0a0')!.rgba, new RGBA(160, 160, 160, 1));
assert.deepEqual(Color.Format.CSS.parseHex('#CFA')!.rgba, new RGBA(204, 255, 170, 1)); assert.deepStrictEqual(Color.Format.CSS.parseHex('#CFA')!.rgba, new RGBA(204, 255, 170, 1));
assert.deepEqual(Color.Format.CSS.parseHex('#CFA8')!.rgba, new RGBA(204, 255, 170, 0.533)); assert.deepStrictEqual(Color.Format.CSS.parseHex('#CFA8')!.rgba, new RGBA(204, 255, 170, 0.533));
}); });
}); });
}); });

View file

@ -179,10 +179,10 @@ suite('Decorators', () => {
t.report(1); t.report(1);
t.report(2); t.report(2);
t.report(3); t.report(3);
assert.deepEqual(spy.args, [[1]]); assert.deepStrictEqual(spy.args, [[1]]);
clock.tick(200); clock.tick(200);
assert.deepEqual(spy.args, [[1], [5]]); assert.deepStrictEqual(spy.args, [[1], [5]]);
spy.reset(); spy.reset();
t.report(4); t.report(4);
@ -190,9 +190,9 @@ suite('Decorators', () => {
clock.tick(50); clock.tick(50);
t.report(6); t.report(6);
assert.deepEqual(spy.args, [[4]]); assert.deepStrictEqual(spy.args, [[4]]);
clock.tick(60); clock.tick(60);
assert.deepEqual(spy.args, [[4], [11]]); assert.deepStrictEqual(spy.args, [[4], [11]]);
} finally { } finally {
clock.restore(); clock.restore();
} }

View file

@ -644,7 +644,7 @@ suite('Event utils', () => {
emitter.fire(1); emitter.fire(1);
emitter.fire(2); emitter.fire(2);
emitter.fire(3); emitter.fire(3);
assert.deepEqual(result, []); assert.deepStrictEqual(result, [] as number[]);
const listener = bufferedEvent(num => result.push(num)); const listener = bufferedEvent(num => result.push(num));
assert.deepStrictEqual(result, [1, 2, 3]); assert.deepStrictEqual(result, [1, 2, 3]);
@ -666,7 +666,7 @@ suite('Event utils', () => {
emitter.fire(1); emitter.fire(1);
emitter.fire(2); emitter.fire(2);
emitter.fire(3); emitter.fire(3);
assert.deepEqual(result, []); assert.deepStrictEqual(result, [] as number[]);
const listener = bufferedEvent(num => result.push(num)); const listener = bufferedEvent(num => result.push(num));
assert.deepStrictEqual(result, []); assert.deepStrictEqual(result, []);
@ -688,7 +688,7 @@ suite('Event utils', () => {
emitter.fire(1); emitter.fire(1);
emitter.fire(2); emitter.fire(2);
emitter.fire(3); emitter.fire(3);
assert.deepEqual(result, []); assert.deepStrictEqual(result, [] as number[]);
bufferedEvent(num => result.push(num)); bufferedEvent(num => result.push(num));
assert.deepStrictEqual(result, [-2, -1, 0, 1, 2, 3]); assert.deepStrictEqual(result, [-2, -1, 0, 1, 2, 3]);

View file

@ -28,22 +28,22 @@ suite('Filters', () => {
counters = [0, 0]; counters = [0, 0];
filter = or(newFilter(0, false), newFilter(1, false)); filter = or(newFilter(0, false), newFilter(1, false));
filterNotOk(filter, 'anything', 'anything'); filterNotOk(filter, 'anything', 'anything');
assert.deepEqual(counters, [1, 1]); assert.deepStrictEqual(counters, [1, 1]);
counters = [0, 0]; counters = [0, 0];
filter = or(newFilter(0, true), newFilter(1, false)); filter = or(newFilter(0, true), newFilter(1, false));
filterOk(filter, 'anything', 'anything'); filterOk(filter, 'anything', 'anything');
assert.deepEqual(counters, [1, 0]); assert.deepStrictEqual(counters, [1, 0]);
counters = [0, 0]; counters = [0, 0];
filter = or(newFilter(0, true), newFilter(1, true)); filter = or(newFilter(0, true), newFilter(1, true));
filterOk(filter, 'anything', 'anything'); filterOk(filter, 'anything', 'anything');
assert.deepEqual(counters, [1, 0]); assert.deepStrictEqual(counters, [1, 0]);
counters = [0, 0]; counters = [0, 0];
filter = or(newFilter(0, false), newFilter(1, true)); filter = or(newFilter(0, false), newFilter(1, true));
filterOk(filter, 'anything', 'anything'); filterOk(filter, 'anything', 'anything');
assert.deepEqual(counters, [1, 1]); assert.deepStrictEqual(counters, [1, 1]);
}); });
test('PrefixFilter - case sensitive', function () { test('PrefixFilter - case sensitive', function () {
@ -201,7 +201,7 @@ suite('Filters', () => {
filterOk(matchesWords, 'öäk', 'Öhm: Älles Klar', [{ start: 0, end: 1 }, { start: 5, end: 6 }, { start: 11, end: 12 }]); filterOk(matchesWords, 'öäk', 'Öhm: Älles Klar', [{ start: 0, end: 1 }, { start: 5, end: 6 }, { start: 11, end: 12 }]);
// assert.ok(matchesWords('gipu', 'Category: Git: Pull', true) === null); // assert.ok(matchesWords('gipu', 'Category: Git: Pull', true) === null);
// assert.deepEqual(matchesWords('pu', 'Category: Git: Pull', true), [{ start: 15, end: 17 }]); // assert.deepStrictEqual(matchesWords('pu', 'Category: Git: Pull', true), [{ start: 15, end: 17 }]);
filterOk(matchesWords, 'bar', 'foo-bar'); filterOk(matchesWords, 'bar', 'foo-bar');
filterOk(matchesWords, 'bar test', 'foo-bar test'); filterOk(matchesWords, 'bar test', 'foo-bar test');

View file

@ -661,15 +661,15 @@ suite('Glob', () => {
}); });
test('split glob aware', function () { test('split glob aware', function () {
assert.deepEqual(glob.splitGlobAware('foo,bar', ','), ['foo', 'bar']); assert.deepStrictEqual(glob.splitGlobAware('foo,bar', ','), ['foo', 'bar']);
assert.deepEqual(glob.splitGlobAware('foo', ','), ['foo']); assert.deepStrictEqual(glob.splitGlobAware('foo', ','), ['foo']);
assert.deepEqual(glob.splitGlobAware('{foo,bar}', ','), ['{foo,bar}']); assert.deepStrictEqual(glob.splitGlobAware('{foo,bar}', ','), ['{foo,bar}']);
assert.deepEqual(glob.splitGlobAware('foo,bar,{foo,bar}', ','), ['foo', 'bar', '{foo,bar}']); assert.deepStrictEqual(glob.splitGlobAware('foo,bar,{foo,bar}', ','), ['foo', 'bar', '{foo,bar}']);
assert.deepEqual(glob.splitGlobAware('{foo,bar},foo,bar,{foo,bar}', ','), ['{foo,bar}', 'foo', 'bar', '{foo,bar}']); assert.deepStrictEqual(glob.splitGlobAware('{foo,bar},foo,bar,{foo,bar}', ','), ['{foo,bar}', 'foo', 'bar', '{foo,bar}']);
assert.deepEqual(glob.splitGlobAware('[foo,bar]', ','), ['[foo,bar]']); assert.deepStrictEqual(glob.splitGlobAware('[foo,bar]', ','), ['[foo,bar]']);
assert.deepEqual(glob.splitGlobAware('foo,bar,[foo,bar]', ','), ['foo', 'bar', '[foo,bar]']); assert.deepStrictEqual(glob.splitGlobAware('foo,bar,[foo,bar]', ','), ['foo', 'bar', '[foo,bar]']);
assert.deepEqual(glob.splitGlobAware('[foo,bar],foo,bar,[foo,bar]', ','), ['[foo,bar]', 'foo', 'bar', '[foo,bar]']); assert.deepStrictEqual(glob.splitGlobAware('[foo,bar],foo,bar,[foo,bar]', ','), ['[foo,bar]', 'foo', 'bar', '[foo,bar]']);
}); });
test('expression with disabled glob', function () { test('expression with disabled glob', function () {

View file

@ -10,7 +10,7 @@ suite('History Navigator', () => {
test('create reduces the input to limit', () => { test('create reduces the input to limit', () => {
const testObject = new HistoryNavigator(['1', '2', '3', '4'], 2); const testObject = new HistoryNavigator(['1', '2', '3', '4'], 2);
assert.deepEqual(['3', '4'], toArray(testObject)); assert.deepStrictEqual(['3', '4'], toArray(testObject));
}); });
test('create sets the position to last', () => { test('create sets the position to last', () => {
@ -77,7 +77,7 @@ suite('History Navigator', () => {
testObject.add('5'); testObject.add('5');
assert.deepEqual(toArray(testObject), ['4', '5']); assert.deepStrictEqual(toArray(testObject), ['4', '5']);
}); });
test('adding existing element changes the position', () => { test('adding existing element changes the position', () => {
@ -85,7 +85,7 @@ suite('History Navigator', () => {
testObject.add('2'); testObject.add('2');
assert.deepEqual(toArray(testObject), ['1', '3', '4', '2']); assert.deepStrictEqual(toArray(testObject), ['1', '3', '4', '2']);
}); });
test('add resets the navigator to last', () => { test('add resets the navigator to last', () => {
@ -103,7 +103,7 @@ suite('History Navigator', () => {
testObject.add('1'); testObject.add('1');
assert.deepEqual(['2', '3', '1'], toArray(testObject)); assert.deepStrictEqual(['2', '3', '1'], toArray(testObject));
}); });
test('previous returns null if the current position is the first one', () => { test('previous returns null if the current position is the first one', () => {
@ -111,7 +111,7 @@ suite('History Navigator', () => {
testObject.first(); testObject.first();
assert.deepEqual(testObject.previous(), null); assert.deepStrictEqual(testObject.previous(), null);
}); });
test('previous returns object if the current position is not the first one', () => { test('previous returns object if the current position is not the first one', () => {
@ -120,7 +120,7 @@ suite('History Navigator', () => {
testObject.first(); testObject.first();
testObject.next(); testObject.next();
assert.deepEqual(testObject.previous(), '1'); assert.deepStrictEqual(testObject.previous(), '1');
}); });
test('next returns null if the current position is the last one', () => { test('next returns null if the current position is the last one', () => {
@ -128,7 +128,7 @@ suite('History Navigator', () => {
testObject.last(); testObject.last();
assert.deepEqual(testObject.next(), null); assert.deepStrictEqual(testObject.next(), null);
}); });
test('next returns object if the current position is not the last one', () => { test('next returns object if the current position is not the last one', () => {
@ -137,7 +137,7 @@ suite('History Navigator', () => {
testObject.last(); testObject.last();
testObject.previous(); testObject.previous();
assert.deepEqual(testObject.next(), '3'); assert.deepStrictEqual(testObject.next(), '3');
}); });
test('clear', () => { test('clear', () => {

View file

@ -16,7 +16,7 @@ function filterOk(filter: IIconFilter, word: string, target: IParsedLabelWithIco
let r = filter(word, target); let r = filter(word, target);
assert(r); assert(r);
if (highlights) { if (highlights) {
assert.deepEqual(r, highlights); assert.deepStrictEqual(r, highlights);
} }
} }

View file

@ -30,7 +30,7 @@ function assertValidParse(input: string, expected: any, options?: ParseOptions):
if (errors.length !== 0) { if (errors.length !== 0) {
assert(false, getParseErrorMessage(errors[0].error)); assert(false, getParseErrorMessage(errors[0].error));
} }
assert.deepEqual(actual, expected); assert.deepStrictEqual(actual, expected);
} }
function assertInvalidParse(input: string, expected: any, options?: ParseOptions): void { function assertInvalidParse(input: string, expected: any, options?: ParseOptions): void {
@ -38,14 +38,14 @@ function assertInvalidParse(input: string, expected: any, options?: ParseOptions
let actual = parse(input, errors, options); let actual = parse(input, errors, options);
assert(errors.length > 0); assert(errors.length > 0);
assert.deepEqual(actual, expected); assert.deepStrictEqual(actual, expected);
} }
function assertTree(input: string, expected: any, expectedErrors: number[] = [], options?: ParseOptions): void { function assertTree(input: string, expected: any, expectedErrors: number[] = [], options?: ParseOptions): void {
let errors: ParseError[] = []; let errors: ParseError[] = [];
let actual = parseTree(input, errors, options); let actual = parseTree(input, errors, options);
assert.deepEqual(errors.map(e => e.error, expected), expectedErrors); assert.deepStrictEqual(errors.map(e => e.error, expected), expectedErrors);
let checkParent = (node: Node) => { let checkParent = (node: Node) => {
if (node.children) { if (node.children) {
for (let child of node.children) { for (let child of node.children) {
@ -57,7 +57,7 @@ function assertTree(input: string, expected: any, expectedErrors: number[] = [],
}; };
checkParent(actual); checkParent(actual);
assert.deepEqual(actual, expected); assert.deepStrictEqual(actual, expected);
} }
suite('JSON', () => { suite('JSON', () => {

View file

@ -37,14 +37,14 @@ suite('Lazy', () => {
assert.strictEqual(outerLazy.hasValue(), false); assert.strictEqual(outerLazy.hasValue(), false);
assert.strictEqual(innerLazy.hasValue(), false); assert.strictEqual(innerLazy.hasValue(), false);
assert.deepEqual(innerLazy.getValue(), [1, 11]); assert.deepStrictEqual(innerLazy.getValue(), [1, 11]);
assert.strictEqual(outerLazy.hasValue(), true); assert.strictEqual(outerLazy.hasValue(), true);
assert.strictEqual(innerLazy.hasValue(), true); assert.strictEqual(innerLazy.hasValue(), true);
assert.strictEqual(outerLazy.getValue(), 1); assert.strictEqual(outerLazy.getValue(), 1);
// make sure we did not evaluate again // make sure we did not evaluate again
assert.strictEqual(outerLazy.getValue(), 1); assert.strictEqual(outerLazy.getValue(), 1);
assert.deepEqual(innerLazy.getValue(), [1, 11]); assert.deepStrictEqual(innerLazy.getValue(), [1, 11]);
}); });
test('map should handle error values', () => { test('map should handle error values', () => {

View file

@ -86,7 +86,7 @@ suite('Objects', () => {
o1: o1, o1: o1,
o2: o1 o2: o1
}; };
assert.deepEqual(objects.cloneAndChange(o, () => { }), o); assert.deepStrictEqual(objects.cloneAndChange(o, () => { }), o);
}); });
test('safeStringify', () => { test('safeStringify', () => {
@ -121,7 +121,7 @@ suite('Objects', () => {
let result = objects.safeStringify(circular); let result = objects.safeStringify(circular);
assert.deepEqual(JSON.parse(result), { assert.deepStrictEqual(JSON.parse(result), {
a: 42, a: 42,
b: '[Circular]', b: '[Circular]',
c: [ c: [

View file

@ -12,7 +12,7 @@ suite('IssueReporter', () => {
test('sets defaults to include all data', () => { test('sets defaults to include all data', () => {
const issueReporterModel = new IssueReporterModel(); const issueReporterModel = new IssueReporterModel();
assert.deepEqual(issueReporterModel.getData(), { assert.deepStrictEqual(issueReporterModel.getData(), {
allExtensions: [], allExtensions: [],
includeSystemInfo: true, includeSystemInfo: true,
includeWorkspaceInfo: true, includeWorkspaceInfo: true,

View file

@ -129,7 +129,7 @@ suite('CodeAction', () => {
const { validActions: actions } = await getCodeActions(model, new Range(1, 1, 2, 1), { type: modes.CodeActionTriggerType.Invoke }, Progress.None, CancellationToken.None); const { validActions: actions } = await getCodeActions(model, new Range(1, 1, 2, 1), { type: modes.CodeActionTriggerType.Invoke }, Progress.None, CancellationToken.None);
assert.strictEqual(actions.length, 6); assert.strictEqual(actions.length, 6);
assert.deepEqual(actions, expected); assert.deepStrictEqual(actions, expected);
}); });
test('getCodeActions should filter by scope', async function () { test('getCodeActions should filter by scope', async function () {

View file

@ -141,11 +141,12 @@ suite('CodeActionModel', () => {
assert.strictEqual(e.trigger.type, modes.CodeActionTriggerType.Auto); assert.strictEqual(e.trigger.type, modes.CodeActionTriggerType.Auto);
const selection = <Selection>e.rangeOrSelection; const selection = <Selection>e.rangeOrSelection;
assert.deepEqual(selection.selectionStartLineNumber, 1); assert.strictEqual(selection.selectionStartLineNumber, 1);
assert.deepEqual(selection.selectionStartColumn, 1); assert.strictEqual(selection.selectionStartColumn, 1);
assert.deepEqual(selection.endLineNumber, 4); assert.strictEqual(selection.endLineNumber, 4);
assert.deepEqual(selection.endColumn, 1); assert.strictEqual(selection.endColumn, 1);
assert.deepEqual(e.position, { lineNumber: 3, column: 1 }); assert.strictEqual(e.position.lineNumber, 3);
assert.strictEqual(e.position.column, 1);
model.dispose(); model.dispose();
resolve(undefined); resolve(undefined);
}, 5)); }, 5));

View file

@ -106,7 +106,7 @@ suite('Folding Model', () => {
actualRanges.push(r(actual.getStartLineNumber(i), actual.getEndLineNumber(i))); actualRanges.push(r(actual.getStartLineNumber(i), actual.getEndLineNumber(i)));
} }
} }
assert.deepEqual(actualRanges, expectedRegions, message); assert.deepStrictEqual(actualRanges, expectedRegions, message);
} }
function assertRanges(foldingModel: FoldingModel, expectedRegions: ExpectedRegion[], message?: string) { function assertRanges(foldingModel: FoldingModel, expectedRegions: ExpectedRegion[], message?: string) {
@ -115,16 +115,16 @@ suite('Folding Model', () => {
for (let i = 0; i < actual.length; i++) { for (let i = 0; i < actual.length; i++) {
actualRanges.push(r(actual.getStartLineNumber(i), actual.getEndLineNumber(i), actual.isCollapsed(i))); actualRanges.push(r(actual.getStartLineNumber(i), actual.getEndLineNumber(i), actual.isCollapsed(i)));
} }
assert.deepEqual(actualRanges, expectedRegions, message); assert.deepStrictEqual(actualRanges, expectedRegions, message);
} }
function assertDecorations(foldingModel: FoldingModel, expectedDecoration: ExpectedDecoration[], message?: string) { function assertDecorations(foldingModel: FoldingModel, expectedDecoration: ExpectedDecoration[], message?: string) {
const decorationProvider = foldingModel.decorationProvider as TestDecorationProvider; const decorationProvider = foldingModel.decorationProvider as TestDecorationProvider;
assert.deepEqual(decorationProvider.getDecorations(), expectedDecoration, message); assert.deepStrictEqual(decorationProvider.getDecorations(), expectedDecoration, message);
} }
function assertRegions(actual: FoldingRegion[], expectedRegions: ExpectedRegion[], message?: string) { function assertRegions(actual: FoldingRegion[], expectedRegions: ExpectedRegion[], message?: string) {
assert.deepEqual(actual.map(r => ({ startLineNumber: r.startLineNumber, endLineNumber: r.endLineNumber, isCollapsed: r.isCollapsed })), expectedRegions, message); assert.deepStrictEqual(actual.map(r => ({ startLineNumber: r.startLineNumber, endLineNumber: r.endLineNumber, isCollapsed: r.isCollapsed })), expectedRegions, message);
} }
test('getRegionAtLine', () => { test('getRegionAtLine', () => {

View file

@ -22,7 +22,7 @@ suite('Hidden Range Model', () => {
} }
function assertRanges(actual: IRange[], expectedRegions: ExpectedRange[], message?: string) { function assertRanges(actual: IRange[], expectedRegions: ExpectedRange[], message?: string) {
assert.deepEqual(actual.map(r => ({ startLineNumber: r.startLineNumber, endLineNumber: r.endLineNumber })), expectedRegions, message); assert.deepStrictEqual(actual.map(r => ({ startLineNumber: r.startLineNumber, endLineNumber: r.endLineNumber })), expectedRegions, message);
} }
test('hasRanges', () => { test('hasRanges', () => {

View file

@ -56,7 +56,7 @@ suite('Indentation Folding', () => {
for (let i = 0; i < indentRanges.length; i++) { for (let i = 0; i < indentRanges.length; i++) {
actual.push({ start: indentRanges.getStartLineNumber(i), end: indentRanges.getEndLineNumber(i) }); actual.push({ start: indentRanges.getStartLineNumber(i), end: indentRanges.getEndLineNumber(i) });
} }
assert.deepEqual(actual, expectedRanges, message); assert.deepStrictEqual(actual, expectedRanges, message);
} }
assertLimit(1000, [r1, r2, r3, r4, r5, r6, r7, r8, r9], '1000'); assertLimit(1000, [r1, r2, r3, r4, r5, r6, r7, r8, r9], '1000');

View file

@ -22,7 +22,7 @@ function assertRanges(lines: string[], expected: ExpectedIndentRange[], offside:
for (let i = 0; i < actual.length; i++) { for (let i = 0; i < actual.length; i++) {
actualRanges[i] = r(actual.getStartLineNumber(i), actual.getEndLineNumber(i), actual.getParentIndex(i)); actualRanges[i] = r(actual.getStartLineNumber(i), actual.getEndLineNumber(i), actual.getParentIndex(i));
} }
assert.deepEqual(actualRanges, expected); assert.deepStrictEqual(actualRanges, expected);
model.dispose(); model.dispose();
} }

View file

@ -81,7 +81,7 @@ suite('Syntax folding', () => {
actual.push({ start: indentRanges.getStartLineNumber(i), end: indentRanges.getEndLineNumber(i) }); actual.push({ start: indentRanges.getStartLineNumber(i), end: indentRanges.getEndLineNumber(i) });
} }
} }
assert.deepEqual(actual, expectedRanges, message); assert.deepStrictEqual(actual, expectedRanges, message);
} }
await assertLimit(1000, [r1, r2, r3, r4, r5, r6, r7, r8, r9], '1000'); await assertLimit(1000, [r1, r2, r3, r4, r5, r6, r7, r8, r9], '1000');

View file

@ -77,7 +77,7 @@ suite('SmartSelect', () => {
let actualStr = actual!.map(r => new Range(r.startLineNumber, r.startColumn, r.endLineNumber, r.endColumn).toString()); let actualStr = actual!.map(r => new Range(r.startLineNumber, r.startColumn, r.endLineNumber, r.endColumn).toString());
let desiredStr = ranges.reverse().map(r => String(r)); let desiredStr = ranges.reverse().map(r => String(r));
assert.deepEqual(actualStr, desiredStr, `\nA: ${actualStr} VS \nE: ${desiredStr}`); assert.deepStrictEqual(actualStr, desiredStr, `\nA: ${actualStr} VS \nE: ${desiredStr}`);
modelService.destroyModel(uri); modelService.destroyModel(uri);
} }

View file

@ -40,13 +40,13 @@ suite('TextResourceConfigurationService - Update', () => {
test('updateValue writes without target and overrides when no language is defined', async () => { test('updateValue writes without target and overrides when no language is defined', async () => {
const resource = URI.file('someFile'); const resource = URI.file('someFile');
await testObject.updateValue(resource, 'a', 'b'); await testObject.updateValue(resource, 'a', 'b');
assert.deepEqual(updateArgs, ['a', 'b', { resource }, ConfigurationTarget.USER_LOCAL]); assert.deepStrictEqual(updateArgs, ['a', 'b', { resource }, ConfigurationTarget.USER_LOCAL]);
}); });
test('updateValue writes with target and without overrides when no language is defined', async () => { test('updateValue writes with target and without overrides when no language is defined', async () => {
const resource = URI.file('someFile'); const resource = URI.file('someFile');
await testObject.updateValue(resource, 'a', 'b', ConfigurationTarget.USER_LOCAL); await testObject.updateValue(resource, 'a', 'b', ConfigurationTarget.USER_LOCAL);
assert.deepEqual(updateArgs, ['a', 'b', { resource }, ConfigurationTarget.USER_LOCAL]); assert.deepStrictEqual(updateArgs, ['a', 'b', { resource }, ConfigurationTarget.USER_LOCAL]);
}); });
test('updateValue writes into given memory target without overrides', async () => { test('updateValue writes into given memory target without overrides', async () => {
@ -59,7 +59,7 @@ suite('TextResourceConfigurationService - Update', () => {
const resource = URI.file('someFile'); const resource = URI.file('someFile');
await testObject.updateValue(resource, 'a', 'b', ConfigurationTarget.MEMORY); await testObject.updateValue(resource, 'a', 'b', ConfigurationTarget.MEMORY);
assert.deepEqual(updateArgs, ['a', 'b', { resource }, ConfigurationTarget.MEMORY]); assert.deepStrictEqual(updateArgs, ['a', 'b', { resource }, ConfigurationTarget.MEMORY]);
}); });
test('updateValue writes into given workspace target without overrides', async () => { test('updateValue writes into given workspace target without overrides', async () => {
@ -72,7 +72,7 @@ suite('TextResourceConfigurationService - Update', () => {
const resource = URI.file('someFile'); const resource = URI.file('someFile');
await testObject.updateValue(resource, 'a', 'b', ConfigurationTarget.WORKSPACE); await testObject.updateValue(resource, 'a', 'b', ConfigurationTarget.WORKSPACE);
assert.deepEqual(updateArgs, ['a', 'b', { resource }, ConfigurationTarget.WORKSPACE]); assert.deepStrictEqual(updateArgs, ['a', 'b', { resource }, ConfigurationTarget.WORKSPACE]);
}); });
test('updateValue writes into given user target without overrides', async () => { test('updateValue writes into given user target without overrides', async () => {
@ -85,7 +85,7 @@ suite('TextResourceConfigurationService - Update', () => {
const resource = URI.file('someFile'); const resource = URI.file('someFile');
await testObject.updateValue(resource, 'a', 'b', ConfigurationTarget.USER); await testObject.updateValue(resource, 'a', 'b', ConfigurationTarget.USER);
assert.deepEqual(updateArgs, ['a', 'b', { resource }, ConfigurationTarget.USER]); assert.deepStrictEqual(updateArgs, ['a', 'b', { resource }, ConfigurationTarget.USER]);
}); });
test('updateValue writes into given workspace folder target with overrides', async () => { test('updateValue writes into given workspace folder target with overrides', async () => {
@ -98,7 +98,7 @@ suite('TextResourceConfigurationService - Update', () => {
const resource = URI.file('someFile'); const resource = URI.file('someFile');
await testObject.updateValue(resource, 'a', 'b', ConfigurationTarget.WORKSPACE_FOLDER); await testObject.updateValue(resource, 'a', 'b', ConfigurationTarget.WORKSPACE_FOLDER);
assert.deepEqual(updateArgs, ['a', 'b', { resource, overrideIdentifier: language }, ConfigurationTarget.WORKSPACE_FOLDER]); assert.deepStrictEqual(updateArgs, ['a', 'b', { resource, overrideIdentifier: language }, ConfigurationTarget.WORKSPACE_FOLDER]);
}); });
test('updateValue writes into derived workspace folder target without overrides', async () => { test('updateValue writes into derived workspace folder target without overrides', async () => {
@ -111,7 +111,7 @@ suite('TextResourceConfigurationService - Update', () => {
const resource = URI.file('someFile'); const resource = URI.file('someFile');
await testObject.updateValue(resource, 'a', 'b'); await testObject.updateValue(resource, 'a', 'b');
assert.deepEqual(updateArgs, ['a', 'b', { resource }, ConfigurationTarget.WORKSPACE_FOLDER]); assert.deepStrictEqual(updateArgs, ['a', 'b', { resource }, ConfigurationTarget.WORKSPACE_FOLDER]);
}); });
test('updateValue writes into derived workspace folder target with overrides', async () => { test('updateValue writes into derived workspace folder target with overrides', async () => {
@ -125,7 +125,7 @@ suite('TextResourceConfigurationService - Update', () => {
const resource = URI.file('someFile'); const resource = URI.file('someFile');
await testObject.updateValue(resource, 'a', 'b'); await testObject.updateValue(resource, 'a', 'b');
assert.deepEqual(updateArgs, ['a', 'b', { resource, overrideIdentifier: language }, ConfigurationTarget.WORKSPACE_FOLDER]); assert.deepStrictEqual(updateArgs, ['a', 'b', { resource, overrideIdentifier: language }, ConfigurationTarget.WORKSPACE_FOLDER]);
}); });
test('updateValue writes into derived workspace target without overrides', async () => { test('updateValue writes into derived workspace target without overrides', async () => {
@ -138,7 +138,7 @@ suite('TextResourceConfigurationService - Update', () => {
const resource = URI.file('someFile'); const resource = URI.file('someFile');
await testObject.updateValue(resource, 'a', 'b'); await testObject.updateValue(resource, 'a', 'b');
assert.deepEqual(updateArgs, ['a', 'b', { resource }, ConfigurationTarget.WORKSPACE]); assert.deepStrictEqual(updateArgs, ['a', 'b', { resource }, ConfigurationTarget.WORKSPACE]);
}); });
test('updateValue writes into derived workspace target with overrides', async () => { test('updateValue writes into derived workspace target with overrides', async () => {
@ -151,7 +151,7 @@ suite('TextResourceConfigurationService - Update', () => {
const resource = URI.file('someFile'); const resource = URI.file('someFile');
await testObject.updateValue(resource, 'a', 'b'); await testObject.updateValue(resource, 'a', 'b');
assert.deepEqual(updateArgs, ['a', 'b', { resource, overrideIdentifier: language }, ConfigurationTarget.WORKSPACE]); assert.deepStrictEqual(updateArgs, ['a', 'b', { resource, overrideIdentifier: language }, ConfigurationTarget.WORKSPACE]);
}); });
test('updateValue writes into derived workspace target with overrides and value defined in folder', async () => { test('updateValue writes into derived workspace target with overrides and value defined in folder', async () => {
@ -165,7 +165,7 @@ suite('TextResourceConfigurationService - Update', () => {
const resource = URI.file('someFile'); const resource = URI.file('someFile');
await testObject.updateValue(resource, 'a', 'b'); await testObject.updateValue(resource, 'a', 'b');
assert.deepEqual(updateArgs, ['a', 'b', { resource, overrideIdentifier: language }, ConfigurationTarget.WORKSPACE]); assert.deepStrictEqual(updateArgs, ['a', 'b', { resource, overrideIdentifier: language }, ConfigurationTarget.WORKSPACE]);
}); });
test('updateValue writes into derived user remote target without overrides', async () => { test('updateValue writes into derived user remote target without overrides', async () => {
@ -178,7 +178,7 @@ suite('TextResourceConfigurationService - Update', () => {
const resource = URI.file('someFile'); const resource = URI.file('someFile');
await testObject.updateValue(resource, 'a', 'b'); await testObject.updateValue(resource, 'a', 'b');
assert.deepEqual(updateArgs, ['a', 'b', { resource }, ConfigurationTarget.USER_REMOTE]); assert.deepStrictEqual(updateArgs, ['a', 'b', { resource }, ConfigurationTarget.USER_REMOTE]);
}); });
test('updateValue writes into derived user remote target with overrides', async () => { test('updateValue writes into derived user remote target with overrides', async () => {
@ -191,7 +191,7 @@ suite('TextResourceConfigurationService - Update', () => {
const resource = URI.file('someFile'); const resource = URI.file('someFile');
await testObject.updateValue(resource, 'a', 'b'); await testObject.updateValue(resource, 'a', 'b');
assert.deepEqual(updateArgs, ['a', 'b', { resource, overrideIdentifier: language }, ConfigurationTarget.USER_REMOTE]); assert.deepStrictEqual(updateArgs, ['a', 'b', { resource, overrideIdentifier: language }, ConfigurationTarget.USER_REMOTE]);
}); });
test('updateValue writes into derived user remote target with overrides and value defined in workspace', async () => { test('updateValue writes into derived user remote target with overrides and value defined in workspace', async () => {
@ -205,7 +205,7 @@ suite('TextResourceConfigurationService - Update', () => {
const resource = URI.file('someFile'); const resource = URI.file('someFile');
await testObject.updateValue(resource, 'a', 'b'); await testObject.updateValue(resource, 'a', 'b');
assert.deepEqual(updateArgs, ['a', 'b', { resource, overrideIdentifier: language }, ConfigurationTarget.USER_REMOTE]); assert.deepStrictEqual(updateArgs, ['a', 'b', { resource, overrideIdentifier: language }, ConfigurationTarget.USER_REMOTE]);
}); });
test('updateValue writes into derived user remote target with overrides and value defined in workspace folder', async () => { test('updateValue writes into derived user remote target with overrides and value defined in workspace folder', async () => {
@ -220,7 +220,7 @@ suite('TextResourceConfigurationService - Update', () => {
const resource = URI.file('someFile'); const resource = URI.file('someFile');
await testObject.updateValue(resource, 'a', 'b'); await testObject.updateValue(resource, 'a', 'b');
assert.deepEqual(updateArgs, ['a', 'b', { resource, overrideIdentifier: language }, ConfigurationTarget.USER_REMOTE]); assert.deepStrictEqual(updateArgs, ['a', 'b', { resource, overrideIdentifier: language }, ConfigurationTarget.USER_REMOTE]);
}); });
test('updateValue writes into derived user target without overrides', async () => { test('updateValue writes into derived user target without overrides', async () => {
@ -232,7 +232,7 @@ suite('TextResourceConfigurationService - Update', () => {
const resource = URI.file('someFile'); const resource = URI.file('someFile');
await testObject.updateValue(resource, 'a', 'b'); await testObject.updateValue(resource, 'a', 'b');
assert.deepEqual(updateArgs, ['a', 'b', { resource }, ConfigurationTarget.USER_LOCAL]); assert.deepStrictEqual(updateArgs, ['a', 'b', { resource }, ConfigurationTarget.USER_LOCAL]);
}); });
test('updateValue writes into derived user target with overrides', async () => { test('updateValue writes into derived user target with overrides', async () => {
@ -244,7 +244,7 @@ suite('TextResourceConfigurationService - Update', () => {
const resource = URI.file('someFile'); const resource = URI.file('someFile');
await testObject.updateValue(resource, 'a', '2'); await testObject.updateValue(resource, 'a', '2');
assert.deepEqual(updateArgs, ['a', '2', { resource, overrideIdentifier: language }, ConfigurationTarget.USER_LOCAL]); assert.deepStrictEqual(updateArgs, ['a', '2', { resource, overrideIdentifier: language }, ConfigurationTarget.USER_LOCAL]);
}); });
test('updateValue writes into derived user target with overrides and value is defined in remote', async () => { test('updateValue writes into derived user target with overrides and value is defined in remote', async () => {
@ -257,7 +257,7 @@ suite('TextResourceConfigurationService - Update', () => {
const resource = URI.file('someFile'); const resource = URI.file('someFile');
await testObject.updateValue(resource, 'a', '2'); await testObject.updateValue(resource, 'a', '2');
assert.deepEqual(updateArgs, ['a', '2', { resource, overrideIdentifier: language }, ConfigurationTarget.USER_LOCAL]); assert.deepStrictEqual(updateArgs, ['a', '2', { resource, overrideIdentifier: language }, ConfigurationTarget.USER_LOCAL]);
}); });
test('updateValue writes into derived user target with overrides and value is defined in workspace', async () => { test('updateValue writes into derived user target with overrides and value is defined in workspace', async () => {
@ -270,7 +270,7 @@ suite('TextResourceConfigurationService - Update', () => {
const resource = URI.file('someFile'); const resource = URI.file('someFile');
await testObject.updateValue(resource, 'a', '2'); await testObject.updateValue(resource, 'a', '2');
assert.deepEqual(updateArgs, ['a', '2', { resource, overrideIdentifier: language }, ConfigurationTarget.USER_LOCAL]); assert.deepStrictEqual(updateArgs, ['a', '2', { resource, overrideIdentifier: language }, ConfigurationTarget.USER_LOCAL]);
}); });
test('updateValue writes into derived user target with overrides and value is defined in workspace folder', async () => { test('updateValue writes into derived user target with overrides and value is defined in workspace folder', async () => {
@ -284,7 +284,7 @@ suite('TextResourceConfigurationService - Update', () => {
const resource = URI.file('someFile'); const resource = URI.file('someFile');
await testObject.updateValue(resource, 'a', '2'); await testObject.updateValue(resource, 'a', '2');
assert.deepEqual(updateArgs, ['a', '2', { resource, overrideIdentifier: language }, ConfigurationTarget.USER_LOCAL]); assert.deepStrictEqual(updateArgs, ['a', '2', { resource, overrideIdentifier: language }, ConfigurationTarget.USER_LOCAL]);
}); });
test('updateValue when not changed', async () => { test('updateValue when not changed', async () => {
@ -295,7 +295,7 @@ suite('TextResourceConfigurationService - Update', () => {
const resource = URI.file('someFile'); const resource = URI.file('someFile');
await testObject.updateValue(resource, 'a', 'b'); await testObject.updateValue(resource, 'a', 'b');
assert.deepEqual(updateArgs, ['a', 'b', { resource }, ConfigurationTarget.USER_LOCAL]); assert.deepStrictEqual(updateArgs, ['a', 'b', { resource }, ConfigurationTarget.USER_LOCAL]);
}); });
}); });

View file

@ -11,10 +11,10 @@ suite('Configuration', () => {
test('simple merge', () => { test('simple merge', () => {
let base = { 'a': 1, 'b': 2 }; let base = { 'a': 1, 'b': 2 };
merge(base, { 'a': 3, 'c': 4 }, true); merge(base, { 'a': 3, 'c': 4 }, true);
assert.deepEqual(base, { 'a': 3, 'b': 2, 'c': 4 }); assert.deepStrictEqual(base, { 'a': 3, 'b': 2, 'c': 4 });
base = { 'a': 1, 'b': 2 }; base = { 'a': 1, 'b': 2 };
merge(base, { 'a': 3, 'c': 4 }, false); merge(base, { 'a': 3, 'c': 4 }, false);
assert.deepEqual(base, { 'a': 1, 'b': 2, 'c': 4 }); assert.deepStrictEqual(base, { 'a': 1, 'b': 2, 'c': 4 });
}); });
test('removeFromValueTree: remove a non existing key', () => { test('removeFromValueTree: remove a non existing key', () => {
@ -22,7 +22,7 @@ suite('Configuration', () => {
removeFromValueTree(target, 'c'); removeFromValueTree(target, 'c');
assert.deepEqual(target, { 'a': { 'b': 2 } }); assert.deepStrictEqual(target, { 'a': { 'b': 2 } });
}); });
test('removeFromValueTree: remove a multi segmented key from an object that has only sub sections of the key', () => { test('removeFromValueTree: remove a multi segmented key from an object that has only sub sections of the key', () => {
@ -30,7 +30,7 @@ suite('Configuration', () => {
removeFromValueTree(target, 'a.b.c'); removeFromValueTree(target, 'a.b.c');
assert.deepEqual(target, { 'a': { 'b': 2 } }); assert.deepStrictEqual(target, { 'a': { 'b': 2 } });
}); });
test('removeFromValueTree: remove a single segmented key', () => { test('removeFromValueTree: remove a single segmented key', () => {
@ -38,7 +38,7 @@ suite('Configuration', () => {
removeFromValueTree(target, 'a'); removeFromValueTree(target, 'a');
assert.deepEqual(target, {}); assert.deepStrictEqual(target, {});
}); });
test('removeFromValueTree: remove a single segmented key when its value is undefined', () => { test('removeFromValueTree: remove a single segmented key when its value is undefined', () => {
@ -46,7 +46,7 @@ suite('Configuration', () => {
removeFromValueTree(target, 'a'); removeFromValueTree(target, 'a');
assert.deepEqual(target, {}); assert.deepStrictEqual(target, {});
}); });
test('removeFromValueTree: remove a multi segmented key when its value is undefined', () => { test('removeFromValueTree: remove a multi segmented key when its value is undefined', () => {
@ -54,7 +54,7 @@ suite('Configuration', () => {
removeFromValueTree(target, 'a.b'); removeFromValueTree(target, 'a.b');
assert.deepEqual(target, {}); assert.deepStrictEqual(target, {});
}); });
test('removeFromValueTree: remove a multi segmented key when its value is array', () => { test('removeFromValueTree: remove a multi segmented key when its value is array', () => {
@ -62,7 +62,7 @@ suite('Configuration', () => {
removeFromValueTree(target, 'a.b'); removeFromValueTree(target, 'a.b');
assert.deepEqual(target, {}); assert.deepStrictEqual(target, {});
}); });
test('removeFromValueTree: remove a multi segmented key first segment value is array', () => { test('removeFromValueTree: remove a multi segmented key first segment value is array', () => {
@ -70,7 +70,7 @@ suite('Configuration', () => {
removeFromValueTree(target, 'a.0'); removeFromValueTree(target, 'a.0');
assert.deepEqual(target, { 'a': [1] }); assert.deepStrictEqual(target, { 'a': [1] });
}); });
test('removeFromValueTree: remove when key is the first segmenet', () => { test('removeFromValueTree: remove when key is the first segmenet', () => {
@ -78,7 +78,7 @@ suite('Configuration', () => {
removeFromValueTree(target, 'a'); removeFromValueTree(target, 'a');
assert.deepEqual(target, {}); assert.deepStrictEqual(target, {});
}); });
test('removeFromValueTree: remove a multi segmented key when the first node has more values', () => { test('removeFromValueTree: remove a multi segmented key when the first node has more values', () => {
@ -86,7 +86,7 @@ suite('Configuration', () => {
removeFromValueTree(target, 'a.b.c'); removeFromValueTree(target, 'a.b.c');
assert.deepEqual(target, { 'a': { 'd': 1 } }); assert.deepStrictEqual(target, { 'a': { 'd': 1 } });
}); });
test('removeFromValueTree: remove a multi segmented key when in between node has more values', () => { test('removeFromValueTree: remove a multi segmented key when in between node has more values', () => {
@ -94,7 +94,7 @@ suite('Configuration', () => {
removeFromValueTree(target, 'a.b.c.d'); removeFromValueTree(target, 'a.b.c.d');
assert.deepEqual(target, { 'a': { 'b': { 'd': 1 } } }); assert.deepStrictEqual(target, { 'a': { 'b': { 'd': 1 } } });
}); });
test('removeFromValueTree: remove a multi segmented key when the last but one node has more values', () => { test('removeFromValueTree: remove a multi segmented key when the last but one node has more values', () => {
@ -102,7 +102,7 @@ suite('Configuration', () => {
removeFromValueTree(target, 'a.b.c'); removeFromValueTree(target, 'a.b.c');
assert.deepEqual(target, { 'a': { 'b': { 'd': 1 } } }); assert.deepStrictEqual(target, { 'a': { 'b': { 'd': 1 } } });
}); });
}); });
@ -111,37 +111,37 @@ suite('Configuration Changes: Merge', () => {
test('merge only keys', () => { test('merge only keys', () => {
const actual = mergeChanges({ keys: ['a', 'b'], overrides: [] }, { keys: ['c', 'd'], overrides: [] }); const actual = mergeChanges({ keys: ['a', 'b'], overrides: [] }, { keys: ['c', 'd'], overrides: [] });
assert.deepEqual(actual, { keys: ['a', 'b', 'c', 'd'], overrides: [] }); assert.deepStrictEqual(actual, { keys: ['a', 'b', 'c', 'd'], overrides: [] });
}); });
test('merge only keys with duplicates', () => { test('merge only keys with duplicates', () => {
const actual = mergeChanges({ keys: ['a', 'b'], overrides: [] }, { keys: ['c', 'd'], overrides: [] }, { keys: ['a', 'd', 'e'], overrides: [] }); const actual = mergeChanges({ keys: ['a', 'b'], overrides: [] }, { keys: ['c', 'd'], overrides: [] }, { keys: ['a', 'd', 'e'], overrides: [] });
assert.deepEqual(actual, { keys: ['a', 'b', 'c', 'd', 'e'], overrides: [] }); assert.deepStrictEqual(actual, { keys: ['a', 'b', 'c', 'd', 'e'], overrides: [] });
}); });
test('merge only overrides', () => { test('merge only overrides', () => {
const actual = mergeChanges({ keys: [], overrides: [['a', ['1', '2']]] }, { keys: [], overrides: [['b', ['3', '4']]] }); const actual = mergeChanges({ keys: [], overrides: [['a', ['1', '2']]] }, { keys: [], overrides: [['b', ['3', '4']]] });
assert.deepEqual(actual, { keys: [], overrides: [['a', ['1', '2']], ['b', ['3', '4']]] }); assert.deepStrictEqual(actual, { keys: [], overrides: [['a', ['1', '2']], ['b', ['3', '4']]] });
}); });
test('merge only overrides with duplicates', () => { test('merge only overrides with duplicates', () => {
const actual = mergeChanges({ keys: [], overrides: [['a', ['1', '2']], ['b', ['5', '4']]] }, { keys: [], overrides: [['b', ['3', '4']]] }, { keys: [], overrides: [['c', ['1', '4']], ['a', ['2', '3']]] }); const actual = mergeChanges({ keys: [], overrides: [['a', ['1', '2']], ['b', ['5', '4']]] }, { keys: [], overrides: [['b', ['3', '4']]] }, { keys: [], overrides: [['c', ['1', '4']], ['a', ['2', '3']]] });
assert.deepEqual(actual, { keys: [], overrides: [['a', ['1', '2', '3']], ['b', ['5', '4', '3']], ['c', ['1', '4']]] }); assert.deepStrictEqual(actual, { keys: [], overrides: [['a', ['1', '2', '3']], ['b', ['5', '4', '3']], ['c', ['1', '4']]] });
}); });
test('merge', () => { test('merge', () => {
const actual = mergeChanges({ keys: ['b', 'b'], overrides: [['a', ['1', '2']], ['b', ['5', '4']]] }, { keys: ['b'], overrides: [['b', ['3', '4']]] }, { keys: ['c', 'a'], overrides: [['c', ['1', '4']], ['a', ['2', '3']]] }); const actual = mergeChanges({ keys: ['b', 'b'], overrides: [['a', ['1', '2']], ['b', ['5', '4']]] }, { keys: ['b'], overrides: [['b', ['3', '4']]] }, { keys: ['c', 'a'], overrides: [['c', ['1', '4']], ['a', ['2', '3']]] });
assert.deepEqual(actual, { keys: ['b', 'c', 'a'], overrides: [['a', ['1', '2', '3']], ['b', ['5', '4', '3']], ['c', ['1', '4']]] }); assert.deepStrictEqual(actual, { keys: ['b', 'c', 'a'], overrides: [['a', ['1', '2', '3']], ['b', ['5', '4', '3']], ['c', ['1', '4']]] });
}); });
test('merge single change', () => { test('merge single change', () => {
const actual = mergeChanges({ keys: ['b', 'b'], overrides: [['a', ['1', '2']], ['b', ['5', '4']]] }); const actual = mergeChanges({ keys: ['b', 'b'], overrides: [['a', ['1', '2']], ['b', ['5', '4']]] });
assert.deepEqual(actual, { keys: ['b', 'b'], overrides: [['a', ['1', '2']], ['b', ['5', '4']]] }); assert.deepStrictEqual(actual, { keys: ['b', 'b'], overrides: [['a', ['1', '2']], ['b', ['5', '4']]] });
}); });
test('merge no changes', () => { test('merge no changes', () => {
const actual = mergeChanges(); const actual = mergeChanges();
assert.deepEqual(actual, { keys: [], overrides: [] }); assert.deepStrictEqual(actual, { keys: [], overrides: [] });
}); });
}); });

View file

@ -19,8 +19,8 @@ suite('ConfigurationModel', () => {
testObject.setValue('f', 1); testObject.setValue('f', 1);
assert.deepEqual(testObject.contents, { 'a': { 'b': 1 }, 'f': 1 }); assert.deepStrictEqual(testObject.contents, { 'a': { 'b': 1 }, 'f': 1 });
assert.deepEqual(testObject.keys, ['a.b', 'f']); assert.deepStrictEqual(testObject.keys, ['a.b', 'f']);
}); });
test('setValue for a key that has no sections and defined', () => { test('setValue for a key that has no sections and defined', () => {
@ -28,8 +28,8 @@ suite('ConfigurationModel', () => {
testObject.setValue('f', 3); testObject.setValue('f', 3);
assert.deepEqual(testObject.contents, { 'a': { 'b': 1 }, 'f': 3 }); assert.deepStrictEqual(testObject.contents, { 'a': { 'b': 1 }, 'f': 3 });
assert.deepEqual(testObject.keys, ['a.b', 'f']); assert.deepStrictEqual(testObject.keys, ['a.b', 'f']);
}); });
test('setValue for a key that has sections and not defined', () => { test('setValue for a key that has sections and not defined', () => {
@ -38,7 +38,7 @@ suite('ConfigurationModel', () => {
testObject.setValue('b.c', 1); testObject.setValue('b.c', 1);
assert.deepEqual(testObject.contents, { 'a': { 'b': 1 }, 'b': { 'c': 1 }, 'f': 1 }); assert.deepEqual(testObject.contents, { 'a': { 'b': 1 }, 'b': { 'c': 1 }, 'f': 1 });
assert.deepEqual(testObject.keys, ['a.b', 'f', 'b.c']); assert.deepStrictEqual(testObject.keys, ['a.b', 'f', 'b.c']);
}); });
test('setValue for a key that has sections and defined', () => { test('setValue for a key that has sections and defined', () => {
@ -46,8 +46,8 @@ suite('ConfigurationModel', () => {
testObject.setValue('b.c', 3); testObject.setValue('b.c', 3);
assert.deepEqual(testObject.contents, { 'a': { 'b': 1 }, 'b': { 'c': 3 }, 'f': 1 }); assert.deepStrictEqual(testObject.contents, { 'a': { 'b': 1 }, 'b': { 'c': 3 }, 'f': 1 });
assert.deepEqual(testObject.keys, ['a.b', 'b.c', 'f']); assert.deepStrictEqual(testObject.keys, ['a.b', 'b.c', 'f']);
}); });
test('setValue for a key that has sections and sub section not defined', () => { test('setValue for a key that has sections and sub section not defined', () => {
@ -55,8 +55,8 @@ suite('ConfigurationModel', () => {
testObject.setValue('a.c', 1); testObject.setValue('a.c', 1);
assert.deepEqual(testObject.contents, { 'a': { 'b': 1, 'c': 1 }, 'f': 1 }); assert.deepStrictEqual(testObject.contents, { 'a': { 'b': 1, 'c': 1 }, 'f': 1 });
assert.deepEqual(testObject.keys, ['a.b', 'f', 'a.c']); assert.deepStrictEqual(testObject.keys, ['a.b', 'f', 'a.c']);
}); });
test('setValue for a key that has sections and sub section defined', () => { test('setValue for a key that has sections and sub section defined', () => {
@ -64,8 +64,8 @@ suite('ConfigurationModel', () => {
testObject.setValue('a.c', 3); testObject.setValue('a.c', 3);
assert.deepEqual(testObject.contents, { 'a': { 'b': 1, 'c': 3 }, 'f': 1 }); assert.deepStrictEqual(testObject.contents, { 'a': { 'b': 1, 'c': 3 }, 'f': 1 });
assert.deepEqual(testObject.keys, ['a.b', 'a.c', 'f']); assert.deepStrictEqual(testObject.keys, ['a.b', 'a.c', 'f']);
}); });
test('setValue for a key that has sections and last section is added', () => { test('setValue for a key that has sections and last section is added', () => {
@ -73,8 +73,8 @@ suite('ConfigurationModel', () => {
testObject.setValue('a.b.c', 1); testObject.setValue('a.b.c', 1);
assert.deepEqual(testObject.contents, { 'a': { 'b': { 'c': 1 } }, 'f': 1 }); assert.deepStrictEqual(testObject.contents, { 'a': { 'b': { 'c': 1 } }, 'f': 1 });
assert.deepEqual(testObject.keys, ['a.b.c', 'f']); assert.deepStrictEqual(testObject.keys, ['a.b.c', 'f']);
}); });
test('removeValue: remove a non existing key', () => { test('removeValue: remove a non existing key', () => {
@ -82,8 +82,8 @@ suite('ConfigurationModel', () => {
testObject.removeValue('a.b.c'); testObject.removeValue('a.b.c');
assert.deepEqual(testObject.contents, { 'a': { 'b': 2 } }); assert.deepStrictEqual(testObject.contents, { 'a': { 'b': 2 } });
assert.deepEqual(testObject.keys, ['a.b']); assert.deepStrictEqual(testObject.keys, ['a.b']);
}); });
test('removeValue: remove a single segmented key', () => { test('removeValue: remove a single segmented key', () => {
@ -91,8 +91,8 @@ suite('ConfigurationModel', () => {
testObject.removeValue('a'); testObject.removeValue('a');
assert.deepEqual(testObject.contents, {}); assert.deepStrictEqual(testObject.contents, {});
assert.deepEqual(testObject.keys, []); assert.deepStrictEqual(testObject.keys, []);
}); });
test('removeValue: remove a multi segmented key', () => { test('removeValue: remove a multi segmented key', () => {
@ -100,8 +100,8 @@ suite('ConfigurationModel', () => {
testObject.removeValue('a.b'); testObject.removeValue('a.b');
assert.deepEqual(testObject.contents, {}); assert.deepStrictEqual(testObject.contents, {});
assert.deepEqual(testObject.keys, []); assert.deepStrictEqual(testObject.keys, []);
}); });
test('get overriding configuration model for an existing identifier', () => { test('get overriding configuration model for an existing identifier', () => {
@ -109,7 +109,7 @@ suite('ConfigurationModel', () => {
{ 'a': { 'b': 1 }, 'f': 1 }, [], { 'a': { 'b': 1 }, 'f': 1 }, [],
[{ identifiers: ['c'], contents: { 'a': { 'd': 1 } }, keys: ['a'] }]); [{ identifiers: ['c'], contents: { 'a': { 'd': 1 } }, keys: ['a'] }]);
assert.deepEqual(testObject.override('c').contents, { 'a': { 'b': 1, 'd': 1 }, 'f': 1 }); assert.deepStrictEqual(testObject.override('c').contents, { 'a': { 'b': 1, 'd': 1 }, 'f': 1 });
}); });
test('get overriding configuration model for an identifier that does not exist', () => { test('get overriding configuration model for an identifier that does not exist', () => {
@ -117,7 +117,7 @@ suite('ConfigurationModel', () => {
{ 'a': { 'b': 1 }, 'f': 1 }, [], { 'a': { 'b': 1 }, 'f': 1 }, [],
[{ identifiers: ['c'], contents: { 'a': { 'd': 1 } }, keys: ['a'] }]); [{ identifiers: ['c'], contents: { 'a': { 'd': 1 } }, keys: ['a'] }]);
assert.deepEqual(testObject.override('xyz').contents, { 'a': { 'b': 1 }, 'f': 1 }); assert.deepStrictEqual(testObject.override('xyz').contents, { 'a': { 'b': 1 }, 'f': 1 });
}); });
test('get overriding configuration when one of the keys does not exist in base', () => { test('get overriding configuration when one of the keys does not exist in base', () => {
@ -125,7 +125,7 @@ suite('ConfigurationModel', () => {
{ 'a': { 'b': 1 }, 'f': 1 }, [], { 'a': { 'b': 1 }, 'f': 1 }, [],
[{ identifiers: ['c'], contents: { 'a': { 'd': 1 }, 'g': 1 }, keys: ['a', 'g'] }]); [{ identifiers: ['c'], contents: { 'a': { 'd': 1 }, 'g': 1 }, keys: ['a', 'g'] }]);
assert.deepEqual(testObject.override('c').contents, { 'a': { 'b': 1, 'd': 1 }, 'f': 1, 'g': 1 }); assert.deepStrictEqual(testObject.override('c').contents, { 'a': { 'b': 1, 'd': 1 }, 'f': 1, 'g': 1 });
}); });
test('get overriding configuration when one of the key in base is not of object type', () => { test('get overriding configuration when one of the key in base is not of object type', () => {
@ -133,7 +133,7 @@ suite('ConfigurationModel', () => {
{ 'a': { 'b': 1 }, 'f': 1 }, [], { 'a': { 'b': 1 }, 'f': 1 }, [],
[{ identifiers: ['c'], contents: { 'a': { 'd': 1 }, 'f': { 'g': 1 } }, keys: ['a', 'f'] }]); [{ identifiers: ['c'], contents: { 'a': { 'd': 1 }, 'f': { 'g': 1 } }, keys: ['a', 'f'] }]);
assert.deepEqual(testObject.override('c').contents, { 'a': { 'b': 1, 'd': 1 }, 'f': { 'g': 1 } }); assert.deepStrictEqual(testObject.override('c').contents, { 'a': { 'b': 1, 'd': 1 }, 'f': { 'g': 1 } });
}); });
test('get overriding configuration when one of the key in overriding contents is not of object type', () => { test('get overriding configuration when one of the key in overriding contents is not of object type', () => {
@ -141,7 +141,7 @@ suite('ConfigurationModel', () => {
{ 'a': { 'b': 1 }, 'f': { 'g': 1 } }, [], { 'a': { 'b': 1 }, 'f': { 'g': 1 } }, [],
[{ identifiers: ['c'], contents: { 'a': { 'd': 1 }, 'f': 1 }, keys: ['a', 'f'] }]); [{ identifiers: ['c'], contents: { 'a': { 'd': 1 }, 'f': 1 }, keys: ['a', 'f'] }]);
assert.deepEqual(testObject.override('c').contents, { 'a': { 'b': 1, 'd': 1 }, 'f': 1 }); assert.deepStrictEqual(testObject.override('c').contents, { 'a': { 'b': 1, 'd': 1 }, 'f': 1 });
}); });
test('get overriding configuration if the value of overriding identifier is not object', () => { test('get overriding configuration if the value of overriding identifier is not object', () => {
@ -149,7 +149,7 @@ suite('ConfigurationModel', () => {
{ 'a': { 'b': 1 }, 'f': { 'g': 1 } }, [], { 'a': { 'b': 1 }, 'f': { 'g': 1 } }, [],
[{ identifiers: ['c'], contents: 'abc', keys: [] }]); [{ identifiers: ['c'], contents: 'abc', keys: [] }]);
assert.deepEqual(testObject.override('c').contents, { 'a': { 'b': 1 }, 'f': { 'g': 1 } }); assert.deepStrictEqual(testObject.override('c').contents, { 'a': { 'b': 1 }, 'f': { 'g': 1 } });
}); });
test('get overriding configuration if the value of overriding identifier is an empty object', () => { test('get overriding configuration if the value of overriding identifier is an empty object', () => {
@ -157,7 +157,7 @@ suite('ConfigurationModel', () => {
{ 'a': { 'b': 1 }, 'f': { 'g': 1 } }, [], { 'a': { 'b': 1 }, 'f': { 'g': 1 } }, [],
[{ identifiers: ['c'], contents: {}, keys: [] }]); [{ identifiers: ['c'], contents: {}, keys: [] }]);
assert.deepEqual(testObject.override('c').contents, { 'a': { 'b': 1 }, 'f': { 'g': 1 } }); assert.deepStrictEqual(testObject.override('c').contents, { 'a': { 'b': 1 }, 'f': { 'g': 1 } });
}); });
test('simple merge', () => { test('simple merge', () => {
@ -165,8 +165,8 @@ suite('ConfigurationModel', () => {
let add = new ConfigurationModel({ 'a': 3, 'c': 4 }, ['a', 'c']); let add = new ConfigurationModel({ 'a': 3, 'c': 4 }, ['a', 'c']);
let result = base.merge(add); let result = base.merge(add);
assert.deepEqual(result.contents, { 'a': 3, 'b': 2, 'c': 4 }); assert.deepStrictEqual(result.contents, { 'a': 3, 'b': 2, 'c': 4 });
assert.deepEqual(result.keys, ['a', 'b', 'c']); assert.deepStrictEqual(result.keys, ['a', 'b', 'c']);
}); });
test('recursive merge', () => { test('recursive merge', () => {
@ -174,9 +174,9 @@ suite('ConfigurationModel', () => {
let add = new ConfigurationModel({ 'a': { 'b': 2 } }, ['a.b']); let add = new ConfigurationModel({ 'a': { 'b': 2 } }, ['a.b']);
let result = base.merge(add); let result = base.merge(add);
assert.deepEqual(result.contents, { 'a': { 'b': 2 } }); assert.deepStrictEqual(result.contents, { 'a': { 'b': 2 } });
assert.deepEqual(result.getValue('a'), { 'b': 2 }); assert.deepStrictEqual(result.getValue('a'), { 'b': 2 });
assert.deepEqual(result.keys, ['a.b']); assert.deepStrictEqual(result.keys, ['a.b']);
}); });
test('simple merge overrides', () => { test('simple merge overrides', () => {
@ -184,10 +184,10 @@ suite('ConfigurationModel', () => {
let add = new ConfigurationModel({ 'a': { 'b': 2 } }, ['a.b'], [{ identifiers: ['c'], contents: { 'b': 2 }, keys: ['b'] }]); let add = new ConfigurationModel({ 'a': { 'b': 2 } }, ['a.b'], [{ identifiers: ['c'], contents: { 'b': 2 }, keys: ['b'] }]);
let result = base.merge(add); let result = base.merge(add);
assert.deepEqual(result.contents, { 'a': { 'b': 2 } }); assert.deepStrictEqual(result.contents, { 'a': { 'b': 2 } });
assert.deepEqual(result.overrides, [{ identifiers: ['c'], contents: { 'a': 2, 'b': 2 }, keys: ['a'] }]); assert.deepStrictEqual(result.overrides, [{ identifiers: ['c'], contents: { 'a': 2, 'b': 2 }, keys: ['a'] }]);
assert.deepEqual(result.override('c').contents, { 'a': 2, 'b': 2 }); assert.deepStrictEqual(result.override('c').contents, { 'a': 2, 'b': 2 });
assert.deepEqual(result.keys, ['a.b']); assert.deepStrictEqual(result.keys, ['a.b']);
}); });
test('recursive merge overrides', () => { test('recursive merge overrides', () => {
@ -195,10 +195,10 @@ suite('ConfigurationModel', () => {
let add = new ConfigurationModel({ 'a': { 'b': 2 } }, ['a.b'], [{ identifiers: ['c'], contents: { 'a': { 'e': 2 } }, keys: ['a'] }]); let add = new ConfigurationModel({ 'a': { 'b': 2 } }, ['a.b'], [{ identifiers: ['c'], contents: { 'a': { 'e': 2 } }, keys: ['a'] }]);
let result = base.merge(add); let result = base.merge(add);
assert.deepEqual(result.contents, { 'a': { 'b': 2 }, 'f': 1 }); assert.deepStrictEqual(result.contents, { 'a': { 'b': 2 }, 'f': 1 });
assert.deepEqual(result.overrides, [{ identifiers: ['c'], contents: { 'a': { 'd': 1, 'e': 2 } }, keys: ['a'] }]); assert.deepStrictEqual(result.overrides, [{ identifiers: ['c'], contents: { 'a': { 'd': 1, 'e': 2 } }, keys: ['a'] }]);
assert.deepEqual(result.override('c').contents, { 'a': { 'b': 2, 'd': 1, 'e': 2 }, 'f': 1 }); assert.deepStrictEqual(result.override('c').contents, { 'a': { 'b': 2, 'd': 1, 'e': 2 }, 'f': 1 });
assert.deepEqual(result.keys, ['a.b', 'f']); assert.deepStrictEqual(result.keys, ['a.b', 'f']);
}); });
test('merge overrides when frozen', () => { test('merge overrides when frozen', () => {
@ -206,30 +206,30 @@ suite('ConfigurationModel', () => {
let model2 = new ConfigurationModel({ 'a': { 'b': 2 } }, ['a.b'], [{ identifiers: ['c'], contents: { 'a': { 'e': 2 } }, keys: ['a'] }]).freeze(); let model2 = new ConfigurationModel({ 'a': { 'b': 2 } }, ['a.b'], [{ identifiers: ['c'], contents: { 'a': { 'e': 2 } }, keys: ['a'] }]).freeze();
let result = new ConfigurationModel().merge(model1, model2); let result = new ConfigurationModel().merge(model1, model2);
assert.deepEqual(result.contents, { 'a': { 'b': 2 }, 'f': 1 }); assert.deepStrictEqual(result.contents, { 'a': { 'b': 2 }, 'f': 1 });
assert.deepEqual(result.overrides, [{ identifiers: ['c'], contents: { 'a': { 'd': 1, 'e': 2 } }, keys: ['a'] }]); assert.deepStrictEqual(result.overrides, [{ identifiers: ['c'], contents: { 'a': { 'd': 1, 'e': 2 } }, keys: ['a'] }]);
assert.deepEqual(result.override('c').contents, { 'a': { 'b': 2, 'd': 1, 'e': 2 }, 'f': 1 }); assert.deepStrictEqual(result.override('c').contents, { 'a': { 'b': 2, 'd': 1, 'e': 2 }, 'f': 1 });
assert.deepEqual(result.keys, ['a.b', 'f']); assert.deepStrictEqual(result.keys, ['a.b', 'f']);
}); });
test('Test contents while getting an existing property', () => { test('Test contents while getting an existing property', () => {
let testObject = new ConfigurationModel({ 'a': 1 }); let testObject = new ConfigurationModel({ 'a': 1 });
assert.deepEqual(testObject.getValue('a'), 1); assert.deepStrictEqual(testObject.getValue('a'), 1);
testObject = new ConfigurationModel({ 'a': { 'b': 1 } }); testObject = new ConfigurationModel({ 'a': { 'b': 1 } });
assert.deepEqual(testObject.getValue('a'), { 'b': 1 }); assert.deepStrictEqual(testObject.getValue('a'), { 'b': 1 });
}); });
test('Test contents are undefined for non existing properties', () => { test('Test contents are undefined for non existing properties', () => {
const testObject = new ConfigurationModel({ awesome: true }); const testObject = new ConfigurationModel({ awesome: true });
assert.deepEqual(testObject.getValue('unknownproperty'), undefined); assert.deepStrictEqual(testObject.getValue('unknownproperty'), undefined);
}); });
test('Test override gives all content merged with overrides', () => { test('Test override gives all content merged with overrides', () => {
const testObject = new ConfigurationModel({ 'a': 1, 'c': 1 }, [], [{ identifiers: ['b'], contents: { 'a': 2 }, keys: ['a'] }]); const testObject = new ConfigurationModel({ 'a': 1, 'c': 1 }, [], [{ identifiers: ['b'], contents: { 'a': 2 }, keys: ['a'] }]);
assert.deepEqual(testObject.override('b').contents, { 'a': 2, 'c': 1 }); assert.deepStrictEqual(testObject.override('b').contents, { 'a': 2, 'c': 1 });
}); });
}); });
@ -243,7 +243,7 @@ suite('CustomConfigurationModel', () => {
add.parseContent(JSON.stringify({ 'a': 3, 'c': 4 })); add.parseContent(JSON.stringify({ 'a': 3, 'c': 4 }));
let result = base.configurationModel.merge(add.configurationModel); let result = base.configurationModel.merge(add.configurationModel);
assert.deepEqual(result.contents, { 'a': 3, 'b': 2, 'c': 4 }); assert.deepStrictEqual(result.contents, { 'a': 3, 'b': 2, 'c': 4 });
}); });
test('simple merge with an undefined contents', () => { test('simple merge with an undefined contents', () => {
@ -251,18 +251,18 @@ suite('CustomConfigurationModel', () => {
base.parseContent(JSON.stringify({ 'a': 1, 'b': 2 })); base.parseContent(JSON.stringify({ 'a': 1, 'b': 2 }));
let add = new ConfigurationModelParser('add'); let add = new ConfigurationModelParser('add');
let result = base.configurationModel.merge(add.configurationModel); let result = base.configurationModel.merge(add.configurationModel);
assert.deepEqual(result.contents, { 'a': 1, 'b': 2 }); assert.deepStrictEqual(result.contents, { 'a': 1, 'b': 2 });
base = new ConfigurationModelParser('base'); base = new ConfigurationModelParser('base');
add = new ConfigurationModelParser('add'); add = new ConfigurationModelParser('add');
add.parseContent(JSON.stringify({ 'a': 1, 'b': 2 })); add.parseContent(JSON.stringify({ 'a': 1, 'b': 2 }));
result = base.configurationModel.merge(add.configurationModel); result = base.configurationModel.merge(add.configurationModel);
assert.deepEqual(result.contents, { 'a': 1, 'b': 2 }); assert.deepStrictEqual(result.contents, { 'a': 1, 'b': 2 });
base = new ConfigurationModelParser('base'); base = new ConfigurationModelParser('base');
add = new ConfigurationModelParser('add'); add = new ConfigurationModelParser('add');
result = base.configurationModel.merge(add.configurationModel); result = base.configurationModel.merge(add.configurationModel);
assert.deepEqual(result.contents, {}); assert.deepStrictEqual(result.contents, {});
}); });
test('Recursive merge using config models', () => { test('Recursive merge using config models', () => {
@ -271,16 +271,16 @@ suite('CustomConfigurationModel', () => {
let add = new ConfigurationModelParser('add'); let add = new ConfigurationModelParser('add');
add.parseContent(JSON.stringify({ 'a': { 'b': 2 } })); add.parseContent(JSON.stringify({ 'a': { 'b': 2 } }));
let result = base.configurationModel.merge(add.configurationModel); let result = base.configurationModel.merge(add.configurationModel);
assert.deepEqual(result.contents, { 'a': { 'b': 2 } }); assert.deepStrictEqual(result.contents, { 'a': { 'b': 2 } });
}); });
test('Test contents while getting an existing property', () => { test('Test contents while getting an existing property', () => {
let testObject = new ConfigurationModelParser('test'); let testObject = new ConfigurationModelParser('test');
testObject.parseContent(JSON.stringify({ 'a': 1 })); testObject.parseContent(JSON.stringify({ 'a': 1 }));
assert.deepEqual(testObject.configurationModel.getValue('a'), 1); assert.deepStrictEqual(testObject.configurationModel.getValue('a'), 1);
testObject.parseContent(JSON.stringify({ 'a': { 'b': 1 } })); testObject.parseContent(JSON.stringify({ 'a': { 'b': 1 } }));
assert.deepEqual(testObject.configurationModel.getValue('a'), { 'b': 1 }); assert.deepStrictEqual(testObject.configurationModel.getValue('a'), { 'b': 1 });
}); });
test('Test contents are undefined for non existing properties', () => { test('Test contents are undefined for non existing properties', () => {
@ -289,26 +289,26 @@ suite('CustomConfigurationModel', () => {
awesome: true awesome: true
})); }));
assert.deepEqual(testObject.configurationModel.getValue('unknownproperty'), undefined); assert.deepStrictEqual(testObject.configurationModel.getValue('unknownproperty'), undefined);
}); });
test('Test contents are undefined for undefined config', () => { test('Test contents are undefined for undefined config', () => {
const testObject = new ConfigurationModelParser('test'); const testObject = new ConfigurationModelParser('test');
assert.deepEqual(testObject.configurationModel.getValue('unknownproperty'), undefined); assert.deepStrictEqual(testObject.configurationModel.getValue('unknownproperty'), undefined);
}); });
test('Test configWithOverrides gives all content merged with overrides', () => { test('Test configWithOverrides gives all content merged with overrides', () => {
const testObject = new ConfigurationModelParser('test'); const testObject = new ConfigurationModelParser('test');
testObject.parseContent(JSON.stringify({ 'a': 1, 'c': 1, '[b]': { 'a': 2 } })); testObject.parseContent(JSON.stringify({ 'a': 1, 'c': 1, '[b]': { 'a': 2 } }));
assert.deepEqual(testObject.configurationModel.override('b').contents, { 'a': 2, 'c': 1, '[b]': { 'a': 2 } }); assert.deepStrictEqual(testObject.configurationModel.override('b').contents, { 'a': 2, 'c': 1, '[b]': { 'a': 2 } });
}); });
test('Test configWithOverrides gives empty contents', () => { test('Test configWithOverrides gives empty contents', () => {
const testObject = new ConfigurationModelParser('test'); const testObject = new ConfigurationModelParser('test');
assert.deepEqual(testObject.configurationModel.override('b').contents, {}); assert.deepStrictEqual(testObject.configurationModel.override('b').contents, {});
}); });
test('Test update with empty data', () => { test('Test update with empty data', () => {
@ -316,17 +316,17 @@ suite('CustomConfigurationModel', () => {
testObject.parseContent(''); testObject.parseContent('');
assert.deepEqual(testObject.configurationModel.contents, {}); assert.deepEqual(testObject.configurationModel.contents, {});
assert.deepEqual(testObject.configurationModel.keys, []); assert.deepStrictEqual(testObject.configurationModel.keys, []);
testObject.parseContent(null!); testObject.parseContent(null!);
assert.deepEqual(testObject.configurationModel.contents, {}); assert.deepEqual(testObject.configurationModel.contents, {});
assert.deepEqual(testObject.configurationModel.keys, []); assert.deepStrictEqual(testObject.configurationModel.keys, []);
testObject.parseContent(undefined!); testObject.parseContent(undefined!);
assert.deepEqual(testObject.configurationModel.contents, {}); assert.deepEqual(testObject.configurationModel.contents, {});
assert.deepEqual(testObject.configurationModel.keys, []); assert.deepStrictEqual(testObject.configurationModel.keys, []);
}); });
test('Test registering the same property again', () => { test('Test registering the same property again', () => {
@ -370,7 +370,7 @@ suite('Configuration', () => {
const { overrideIdentifiers } = testObject.inspect('a', {}, undefined); const { overrideIdentifiers } = testObject.inspect('a', {}, undefined);
assert.deepEqual(overrideIdentifiers, ['l1', 'l3', 'l4']); assert.deepStrictEqual(overrideIdentifiers, ['l1', 'l3', 'l4']);
}); });
test('Test update value', () => { test('Test update value', () => {
@ -407,7 +407,7 @@ suite('Configuration', () => {
} }
}), ['editor.lineNumbers', '[markdown]']); }), ['editor.lineNumbers', '[markdown]']);
assert.deepEqual(actual, { keys: ['editor.lineNumbers', '[markdown]'], overrides: [['markdown', ['editor.wordWrap']]] }); assert.deepStrictEqual(actual, { keys: ['editor.lineNumbers', '[markdown]'], overrides: [['markdown', ['editor.wordWrap']]] });
}); });
@ -430,7 +430,7 @@ suite('Configuration', () => {
} }
})); }));
assert.deepEqual(actual, { keys: ['window.zoomLevel', 'editor.lineNumbers', '[typescript]', 'editor.fontSize'], overrides: [['typescript', ['editor.insertSpaces', 'editor.wordWrap']]] }); assert.deepStrictEqual(actual, { keys: ['window.zoomLevel', 'editor.lineNumbers', '[typescript]', 'editor.fontSize'], overrides: [['typescript', ['editor.insertSpaces', 'editor.wordWrap']]] });
}); });
@ -453,7 +453,7 @@ suite('Configuration', () => {
} }
})); }));
assert.deepEqual(actual, { keys: ['window.zoomLevel', 'editor.lineNumbers', '[typescript]', 'editor.fontSize'], overrides: [['typescript', ['editor.insertSpaces', 'editor.wordWrap']]] }); assert.deepStrictEqual(actual, { keys: ['window.zoomLevel', 'editor.lineNumbers', '[typescript]', 'editor.fontSize'], overrides: [['typescript', ['editor.insertSpaces', 'editor.wordWrap']]] });
}); });
@ -476,7 +476,7 @@ suite('Configuration', () => {
} }
})); }));
assert.deepEqual(actual, { keys: ['window.zoomLevel', 'editor.lineNumbers', '[typescript]', 'editor.fontSize'], overrides: [['typescript', ['editor.insertSpaces', 'editor.wordWrap']]] }); assert.deepStrictEqual(actual, { keys: ['window.zoomLevel', 'editor.lineNumbers', '[typescript]', 'editor.fontSize'], overrides: [['typescript', ['editor.insertSpaces', 'editor.wordWrap']]] });
}); });
@ -492,7 +492,7 @@ suite('Configuration', () => {
const actual = testObject.compareAndDeleteFolderConfiguration(URI.file('file1')); const actual = testObject.compareAndDeleteFolderConfiguration(URI.file('file1'));
assert.deepEqual(actual, { keys: ['editor.lineNumbers', 'editor.fontSize', '[typescript]'], overrides: [['typescript', ['editor.wordWrap']]] }); assert.deepStrictEqual(actual, { keys: ['editor.lineNumbers', 'editor.fontSize', '[typescript]'], overrides: [['typescript', ['editor.wordWrap']]] });
}); });
@ -515,7 +515,7 @@ suite('ConfigurationChangeEvent', () => {
})); }));
let testObject = new ConfigurationChangeEvent(change, undefined, configuration); let testObject = new ConfigurationChangeEvent(change, undefined, configuration);
assert.deepEqual(testObject.affectedKeys, ['window.zoomLevel', 'workbench.editor.enablePreview', 'files.autoSave']); assert.deepStrictEqual(testObject.affectedKeys, ['window.zoomLevel', 'workbench.editor.enablePreview', 'files.autoSave']);
assert.ok(testObject.affectsConfiguration('window.zoomLevel')); assert.ok(testObject.affectsConfiguration('window.zoomLevel'));
assert.ok(testObject.affectsConfiguration('window')); assert.ok(testObject.affectsConfiguration('window'));
@ -547,7 +547,7 @@ suite('ConfigurationChangeEvent', () => {
})); }));
let testObject = new ConfigurationChangeEvent(change, { data }, configuration); let testObject = new ConfigurationChangeEvent(change, { data }, configuration);
assert.deepEqual(testObject.affectedKeys, ['window.zoomLevel', 'workbench.editor.enablePreview']); assert.deepStrictEqual(testObject.affectedKeys, ['window.zoomLevel', 'workbench.editor.enablePreview']);
assert.ok(testObject.affectsConfiguration('window.zoomLevel')); assert.ok(testObject.affectsConfiguration('window.zoomLevel'));
assert.ok(testObject.affectsConfiguration('window')); assert.ok(testObject.affectsConfiguration('window'));
@ -571,7 +571,7 @@ suite('ConfigurationChangeEvent', () => {
})); }));
let testObject = new ConfigurationChangeEvent(change, undefined, configuration); let testObject = new ConfigurationChangeEvent(change, undefined, configuration);
assert.deepEqual(testObject.affectedKeys, ['files.autoSave', '[markdown]', 'editor.wordWrap']); assert.deepStrictEqual(testObject.affectedKeys, ['files.autoSave', '[markdown]', 'editor.wordWrap']);
assert.ok(testObject.affectsConfiguration('files')); assert.ok(testObject.affectsConfiguration('files'));
assert.ok(testObject.affectsConfiguration('files.autoSave')); assert.ok(testObject.affectsConfiguration('files.autoSave'));
@ -613,7 +613,7 @@ suite('ConfigurationChangeEvent', () => {
})); }));
let testObject = new ConfigurationChangeEvent(change, { data }, configuration); let testObject = new ConfigurationChangeEvent(change, { data }, configuration);
assert.deepEqual(testObject.affectedKeys, ['window.zoomLevel', '[markdown]', 'workbench.editor.enablePreview', 'editor.fontSize']); assert.deepStrictEqual(testObject.affectedKeys, ['window.zoomLevel', '[markdown]', 'workbench.editor.enablePreview', 'editor.fontSize']);
assert.ok(!testObject.affectsConfiguration('files')); assert.ok(!testObject.affectsConfiguration('files'));
@ -657,7 +657,7 @@ suite('ConfigurationChangeEvent', () => {
); );
let testObject = new ConfigurationChangeEvent(change, { data, workspace }, configuration, workspace); let testObject = new ConfigurationChangeEvent(change, { data, workspace }, configuration, workspace);
assert.deepEqual(testObject.affectedKeys, ['window.title', 'window.zoomLevel', 'window.restoreFullscreen', 'workbench.editor.enablePreview', 'window.restoreWindows']); assert.deepStrictEqual(testObject.affectedKeys, ['window.title', 'window.zoomLevel', 'window.restoreFullscreen', 'workbench.editor.enablePreview', 'window.restoreWindows']);
assert.ok(testObject.affectsConfiguration('window.zoomLevel')); assert.ok(testObject.affectsConfiguration('window.zoomLevel'));
assert.ok(testObject.affectsConfiguration('window.zoomLevel', { resource: URI.file('folder1') })); assert.ok(testObject.affectsConfiguration('window.zoomLevel', { resource: URI.file('folder1') }));
@ -755,7 +755,7 @@ suite('ConfigurationChangeEvent', () => {
const workspace = new Workspace('a', [new WorkspaceFolder({ index: 0, name: 'a', uri: URI.file('file1') }), new WorkspaceFolder({ index: 1, name: 'b', uri: URI.file('file2') }), new WorkspaceFolder({ index: 2, name: 'c', uri: URI.file('folder3') })]); const workspace = new Workspace('a', [new WorkspaceFolder({ index: 0, name: 'a', uri: URI.file('file1') }), new WorkspaceFolder({ index: 1, name: 'b', uri: URI.file('file2') }), new WorkspaceFolder({ index: 2, name: 'c', uri: URI.file('folder3') })]);
const testObject = new ConfigurationChangeEvent(change, { data, workspace }, configuration, workspace); const testObject = new ConfigurationChangeEvent(change, { data, workspace }, configuration, workspace);
assert.deepEqual(testObject.affectedKeys, ['editor.lineNumbers', '[markdown]', '[json]', 'window.title', 'window.zoomLevel', 'window.restoreFullscreen', 'workbench.editor.enablePreview', 'window.restoreWindows', 'editor.wordWrap']); assert.deepStrictEqual(testObject.affectedKeys, ['editor.lineNumbers', '[markdown]', '[json]', 'window.title', 'window.zoomLevel', 'window.restoreFullscreen', 'workbench.editor.enablePreview', 'window.restoreWindows', 'editor.wordWrap']);
assert.ok(testObject.affectsConfiguration('window.title')); assert.ok(testObject.affectsConfiguration('window.title'));
assert.ok(testObject.affectsConfiguration('window.title', { resource: URI.file('file1') })); assert.ok(testObject.affectsConfiguration('window.title', { resource: URI.file('file1') }));
@ -841,7 +841,7 @@ suite('ConfigurationChangeEvent', () => {
})); }));
let testObject = new ConfigurationChangeEvent(change, undefined, configuration); let testObject = new ConfigurationChangeEvent(change, undefined, configuration);
assert.deepEqual(testObject.affectedKeys, ['launch', 'launch.version', 'tasks']); assert.deepStrictEqual(testObject.affectedKeys, ['launch', 'launch.version', 'tasks']);
assert.ok(testObject.affectsConfiguration('launch')); assert.ok(testObject.affectsConfiguration('launch'));
assert.ok(testObject.affectsConfiguration('launch.version')); assert.ok(testObject.affectsConfiguration('launch.version'));
assert.ok(testObject.affectsConfiguration('tasks')); assert.ok(testObject.affectsConfiguration('tasks'));
@ -870,7 +870,7 @@ suite('AllKeysConfigurationChangeEvent', () => {
const workspace = new Workspace('a', [new WorkspaceFolder({ index: 0, name: 'a', uri: URI.file('file1') }), new WorkspaceFolder({ index: 1, name: 'b', uri: URI.file('file2') }), new WorkspaceFolder({ index: 2, name: 'c', uri: URI.file('folder3') })]); const workspace = new Workspace('a', [new WorkspaceFolder({ index: 0, name: 'a', uri: URI.file('file1') }), new WorkspaceFolder({ index: 1, name: 'b', uri: URI.file('file2') }), new WorkspaceFolder({ index: 2, name: 'c', uri: URI.file('folder3') })]);
let testObject = new AllKeysConfigurationChangeEvent(configuration, workspace, ConfigurationTarget.USER, null); let testObject = new AllKeysConfigurationChangeEvent(configuration, workspace, ConfigurationTarget.USER, null);
assert.deepEqual(testObject.affectedKeys, ['editor.lineNumbers', '[markdown]', '[json]', 'window.title', 'window.zoomLevel', 'window.restoreFullscreen', 'workbench.editor.enablePreview', 'window.restoreWindows']); assert.deepStrictEqual(testObject.affectedKeys, ['editor.lineNumbers', '[markdown]', '[json]', 'window.title', 'window.zoomLevel', 'window.restoreFullscreen', 'workbench.editor.enablePreview', 'window.restoreWindows']);
assert.ok(testObject.affectsConfiguration('window.title')); assert.ok(testObject.affectsConfiguration('window.title'));
assert.ok(testObject.affectsConfiguration('window.title', { resource: URI.file('file1') })); assert.ok(testObject.affectsConfiguration('window.title', { resource: URI.file('file1') }));

View file

@ -24,15 +24,15 @@ suite('ConfigurationRegistry', () => {
configurationRegistry.registerDefaultConfigurations([{ 'config': { a: 1, b: 2 } }]); configurationRegistry.registerDefaultConfigurations([{ 'config': { a: 1, b: 2 } }]);
configurationRegistry.registerDefaultConfigurations([{ '[lang]': { a: 2, c: 3 } }]); configurationRegistry.registerDefaultConfigurations([{ '[lang]': { a: 2, c: 3 } }]);
assert.deepEqual(configurationRegistry.getConfigurationProperties()['config'].default, { a: 1, b: 2 }); assert.deepStrictEqual(configurationRegistry.getConfigurationProperties()['config'].default, { a: 1, b: 2 });
assert.deepEqual(configurationRegistry.getConfigurationProperties()['[lang]'].default, { a: 2, c: 3 }); assert.deepStrictEqual(configurationRegistry.getConfigurationProperties()['[lang]'].default, { a: 2, c: 3 });
}); });
test('configuration override defaults - merges defaults', async () => { test('configuration override defaults - merges defaults', async () => {
configurationRegistry.registerDefaultConfigurations([{ '[lang]': { a: 1, b: 2 } }]); configurationRegistry.registerDefaultConfigurations([{ '[lang]': { a: 1, b: 2 } }]);
configurationRegistry.registerDefaultConfigurations([{ '[lang]': { a: 2, c: 3 } }]); configurationRegistry.registerDefaultConfigurations([{ '[lang]': { a: 2, c: 3 } }]);
assert.deepEqual(configurationRegistry.getConfigurationProperties()['[lang]'].default, { a: 2, b: 2, c: 3 }); assert.deepStrictEqual(configurationRegistry.getConfigurationProperties()['[lang]'].default, { a: 2, b: 2, c: 3 });
}); });
test('configuration defaults - overrides defaults', async () => { test('configuration defaults - overrides defaults', async () => {
@ -48,6 +48,6 @@ suite('ConfigurationRegistry', () => {
configurationRegistry.registerDefaultConfigurations([{ 'config': { a: 1, b: 2 } }]); configurationRegistry.registerDefaultConfigurations([{ 'config': { a: 1, b: 2 } }]);
configurationRegistry.registerDefaultConfigurations([{ 'config': { a: 2, c: 3 } }]); configurationRegistry.registerDefaultConfigurations([{ 'config': { a: 2, c: 3 } }]);
assert.deepEqual(configurationRegistry.getConfigurationProperties()['config'].default, { a: 2, c: 3 }); assert.deepStrictEqual(configurationRegistry.getConfigurationProperties()['config'].default, { a: 2, c: 3 });
}); });
}); });

View file

@ -16,13 +16,13 @@ suite('formatOptions', () => {
} }
test('Text should display small columns correctly', () => { test('Text should display small columns correctly', () => {
assert.deepEqual( assert.deepStrictEqual(
formatOptions({ formatOptions({
'add': o('bar') 'add': o('bar')
}, 80), }, 80),
[' --add bar'] [' --add bar']
); );
assert.deepEqual( assert.deepStrictEqual(
formatOptions({ formatOptions({
'add': o('bar'), 'add': o('bar'),
'wait': o('ba'), 'wait': o('ba'),
@ -36,7 +36,7 @@ suite('formatOptions', () => {
}); });
test('Text should wrap', () => { test('Text should wrap', () => {
assert.deepEqual( assert.deepStrictEqual(
formatOptions({ formatOptions({
'add': o((<any>'bar ').repeat(9)) 'add': o((<any>'bar ').repeat(9))
}, 40), }, 40),
@ -47,7 +47,7 @@ suite('formatOptions', () => {
}); });
test('Text should revert to the condensed view when the terminal is too narrow', () => { test('Text should revert to the condensed view when the terminal is too narrow', () => {
assert.deepEqual( assert.deepStrictEqual(
formatOptions({ formatOptions({
'add': o((<any>'bar ').repeat(9)) 'add': o((<any>'bar ').repeat(9))
}, 30), }, 30),
@ -58,11 +58,11 @@ suite('formatOptions', () => {
}); });
test('addArg', () => { test('addArg', () => {
assert.deepEqual(addArg([], 'foo'), ['foo']); assert.deepStrictEqual(addArg([], 'foo'), ['foo']);
assert.deepEqual(addArg([], 'foo', 'bar'), ['foo', 'bar']); assert.deepStrictEqual(addArg([], 'foo', 'bar'), ['foo', 'bar']);
assert.deepEqual(addArg(['foo'], 'bar'), ['foo', 'bar']); assert.deepStrictEqual(addArg(['foo'], 'bar'), ['foo', 'bar']);
assert.deepEqual(addArg(['--wait'], 'bar'), ['--wait', 'bar']); assert.deepStrictEqual(addArg(['--wait'], 'bar'), ['--wait', 'bar']);
assert.deepEqual(addArg(['--wait', '--', '--foo'], 'bar'), ['--wait', 'bar', '--', '--foo']); assert.deepStrictEqual(addArg(['--wait', '--', '--foo'], 'bar'), ['--wait', 'bar', '--', '--foo']);
assert.deepEqual(addArg(['--', '--foo'], 'bar'), ['bar', '--', '--foo']); assert.deepStrictEqual(addArg(['--', '--foo'], 'bar'), ['bar', '--', '--foo']);
}); });
}); });

View file

@ -13,22 +13,22 @@ suite('Graph', () => {
}); });
test('is possible to lookup nodes that don\'t exist', function () { test('is possible to lookup nodes that don\'t exist', function () {
assert.deepEqual(graph.lookup('ddd'), null); assert.strictEqual(graph.lookup('ddd'), undefined);
}); });
test('inserts nodes when not there yet', function () { test('inserts nodes when not there yet', function () {
assert.deepEqual(graph.lookup('ddd'), null); assert.strictEqual(graph.lookup('ddd'), undefined);
assert.deepEqual(graph.lookupOrInsertNode('ddd').data, 'ddd'); assert.strictEqual(graph.lookupOrInsertNode('ddd').data, 'ddd');
assert.deepEqual(graph.lookup('ddd')!.data, 'ddd'); assert.strictEqual(graph.lookup('ddd')!.data, 'ddd');
}); });
test('can remove nodes and get length', function () { test('can remove nodes and get length', function () {
assert.ok(graph.isEmpty()); assert.ok(graph.isEmpty());
assert.deepEqual(graph.lookup('ddd'), null); assert.strictEqual(graph.lookup('ddd'), undefined);
assert.deepEqual(graph.lookupOrInsertNode('ddd').data, 'ddd'); assert.strictEqual(graph.lookupOrInsertNode('ddd').data, 'ddd');
assert.ok(!graph.isEmpty()); assert.ok(!graph.isEmpty());
graph.removeNode('ddd'); graph.removeNode('ddd');
assert.deepEqual(graph.lookup('ddd'), null); assert.strictEqual(graph.lookup('ddd'), undefined);
assert.ok(graph.isEmpty()); assert.ok(graph.isEmpty());
}); });

View file

@ -18,10 +18,10 @@ suite('ExtensionsMerge', () => {
const actual = merge(localExtensions, null, null, [], []); const actual = merge(localExtensions, null, null, [], []);
assert.deepEqual(actual.added, []); assert.deepStrictEqual(actual.added, []);
assert.deepEqual(actual.removed, []); assert.deepStrictEqual(actual.removed, []);
assert.deepEqual(actual.updated, []); assert.deepStrictEqual(actual.updated, []);
assert.deepEqual(actual.remote, localExtensions); assert.deepStrictEqual(actual.remote, localExtensions);
}); });
test('merge returns local extension if remote does not exist with ignored extensions', () => { test('merge returns local extension if remote does not exist with ignored extensions', () => {
@ -37,10 +37,10 @@ suite('ExtensionsMerge', () => {
const actual = merge(localExtensions, null, null, [], ['a']); const actual = merge(localExtensions, null, null, [], ['a']);
assert.deepEqual(actual.added, []); assert.deepStrictEqual(actual.added, []);
assert.deepEqual(actual.removed, []); assert.deepStrictEqual(actual.removed, []);
assert.deepEqual(actual.updated, []); assert.deepStrictEqual(actual.updated, []);
assert.deepEqual(actual.remote, expected); assert.deepStrictEqual(actual.remote, expected);
}); });
test('merge returns local extension if remote does not exist with ignored extensions (ignore case)', () => { test('merge returns local extension if remote does not exist with ignored extensions (ignore case)', () => {
@ -56,10 +56,10 @@ suite('ExtensionsMerge', () => {
const actual = merge(localExtensions, null, null, [], ['A']); const actual = merge(localExtensions, null, null, [], ['A']);
assert.deepEqual(actual.added, []); assert.deepStrictEqual(actual.added, []);
assert.deepEqual(actual.removed, []); assert.deepStrictEqual(actual.removed, []);
assert.deepEqual(actual.updated, []); assert.deepStrictEqual(actual.updated, []);
assert.deepEqual(actual.remote, expected); assert.deepStrictEqual(actual.remote, expected);
}); });
test('merge returns local extension if remote does not exist with skipped extensions', () => { test('merge returns local extension if remote does not exist with skipped extensions', () => {
@ -79,10 +79,10 @@ suite('ExtensionsMerge', () => {
const actual = merge(localExtensions, null, null, skippedExtension, []); const actual = merge(localExtensions, null, null, skippedExtension, []);
assert.deepEqual(actual.added, []); assert.deepStrictEqual(actual.added, []);
assert.deepEqual(actual.removed, []); assert.deepStrictEqual(actual.removed, []);
assert.deepEqual(actual.updated, []); assert.deepStrictEqual(actual.updated, []);
assert.deepEqual(actual.remote, expected); assert.deepStrictEqual(actual.remote, expected);
}); });
test('merge returns local extension if remote does not exist with skipped and ignored extensions', () => { test('merge returns local extension if remote does not exist with skipped and ignored extensions', () => {
@ -101,10 +101,10 @@ suite('ExtensionsMerge', () => {
const actual = merge(localExtensions, null, null, skippedExtension, ['a']); const actual = merge(localExtensions, null, null, skippedExtension, ['a']);
assert.deepEqual(actual.added, []); assert.deepStrictEqual(actual.added, []);
assert.deepEqual(actual.removed, []); assert.deepStrictEqual(actual.removed, []);
assert.deepEqual(actual.updated, []); assert.deepStrictEqual(actual.updated, []);
assert.deepEqual(actual.remote, expected); assert.deepStrictEqual(actual.remote, expected);
}); });
test('merge local and remote extensions when there is no base', () => { test('merge local and remote extensions when there is no base', () => {
@ -125,10 +125,10 @@ suite('ExtensionsMerge', () => {
const actual = merge(localExtensions, remoteExtensions, null, [], []); const actual = merge(localExtensions, remoteExtensions, null, [], []);
assert.deepEqual(actual.added, [{ identifier: { id: 'b', uuid: 'b' }, installed: true, version: '1.0.0' }, { identifier: { id: 'c', uuid: 'c' }, installed: true, version: '1.0.0' }]); assert.deepStrictEqual(actual.added, [{ identifier: { id: 'b', uuid: 'b' }, installed: true, version: '1.0.0' }, { identifier: { id: 'c', uuid: 'c' }, installed: true, version: '1.0.0' }]);
assert.deepEqual(actual.removed, []); assert.deepStrictEqual(actual.removed, []);
assert.deepEqual(actual.updated, []); assert.deepStrictEqual(actual.updated, []);
assert.deepEqual(actual.remote, expected); assert.deepStrictEqual(actual.remote, expected);
}); });
test('merge local and remote extensions when there is no base and with ignored extensions', () => { test('merge local and remote extensions when there is no base and with ignored extensions', () => {
@ -148,10 +148,10 @@ suite('ExtensionsMerge', () => {
const actual = merge(localExtensions, remoteExtensions, null, [], ['a']); const actual = merge(localExtensions, remoteExtensions, null, [], ['a']);
assert.deepEqual(actual.added, [{ identifier: { id: 'b', uuid: 'b' }, installed: true, version: '1.0.0' }, { identifier: { id: 'c', uuid: 'c' }, installed: true, version: '1.0.0' }]); assert.deepStrictEqual(actual.added, [{ identifier: { id: 'b', uuid: 'b' }, installed: true, version: '1.0.0' }, { identifier: { id: 'c', uuid: 'c' }, installed: true, version: '1.0.0' }]);
assert.deepEqual(actual.removed, []); assert.deepStrictEqual(actual.removed, []);
assert.deepEqual(actual.updated, []); assert.deepStrictEqual(actual.updated, []);
assert.deepEqual(actual.remote, expected); assert.deepStrictEqual(actual.remote, expected);
}); });
test('merge local and remote extensions when remote is moved forwarded', () => { test('merge local and remote extensions when remote is moved forwarded', () => {
@ -170,9 +170,9 @@ suite('ExtensionsMerge', () => {
const actual = merge(localExtensions, remoteExtensions, baseExtensions, [], []); const actual = merge(localExtensions, remoteExtensions, baseExtensions, [], []);
assert.deepEqual(actual.added, [{ identifier: { id: 'b', uuid: 'b' }, installed: true, version: '1.0.0' }, { identifier: { id: 'c', uuid: 'c' }, installed: true, version: '1.0.0' }]); assert.deepStrictEqual(actual.added, [{ identifier: { id: 'b', uuid: 'b' }, installed: true, version: '1.0.0' }, { identifier: { id: 'c', uuid: 'c' }, installed: true, version: '1.0.0' }]);
assert.deepEqual(actual.removed, [{ id: 'a', uuid: 'a' }, { id: 'd', uuid: 'd' }]); assert.deepStrictEqual(actual.removed, [{ id: 'a', uuid: 'a' }, { id: 'd', uuid: 'd' }]);
assert.deepEqual(actual.updated, []); assert.deepStrictEqual(actual.updated, []);
assert.strictEqual(actual.remote, null); assert.strictEqual(actual.remote, null);
}); });
@ -193,9 +193,9 @@ suite('ExtensionsMerge', () => {
const actual = merge(localExtensions, remoteExtensions, baseExtensions, [], []); const actual = merge(localExtensions, remoteExtensions, baseExtensions, [], []);
assert.deepEqual(actual.added, [{ identifier: { id: 'b', uuid: 'b' }, installed: true, version: '1.0.0' }, { identifier: { id: 'c', uuid: 'c' }, installed: true, version: '1.0.0' }]); assert.deepStrictEqual(actual.added, [{ identifier: { id: 'b', uuid: 'b' }, installed: true, version: '1.0.0' }, { identifier: { id: 'c', uuid: 'c' }, installed: true, version: '1.0.0' }]);
assert.deepEqual(actual.removed, [{ id: 'a', uuid: 'a' }]); assert.deepStrictEqual(actual.removed, [{ id: 'a', uuid: 'a' }]);
assert.deepEqual(actual.updated, [{ identifier: { id: 'd', uuid: 'd' }, disabled: true, installed: true, version: '1.0.0' }]); assert.deepStrictEqual(actual.updated, [{ identifier: { id: 'd', uuid: 'd' }, disabled: true, installed: true, version: '1.0.0' }]);
assert.strictEqual(actual.remote, null); assert.strictEqual(actual.remote, null);
}); });
@ -215,9 +215,9 @@ suite('ExtensionsMerge', () => {
const actual = merge(localExtensions, remoteExtensions, baseExtensions, [], ['a']); const actual = merge(localExtensions, remoteExtensions, baseExtensions, [], ['a']);
assert.deepEqual(actual.added, [{ identifier: { id: 'b', uuid: 'b' }, installed: true, version: '1.0.0' }, { identifier: { id: 'c', uuid: 'c' }, installed: true, version: '1.0.0' }]); assert.deepStrictEqual(actual.added, [{ identifier: { id: 'b', uuid: 'b' }, installed: true, version: '1.0.0' }, { identifier: { id: 'c', uuid: 'c' }, installed: true, version: '1.0.0' }]);
assert.deepEqual(actual.removed, [{ id: 'd', uuid: 'd' }]); assert.deepStrictEqual(actual.removed, [{ id: 'd', uuid: 'd' }]);
assert.deepEqual(actual.updated, []); assert.deepStrictEqual(actual.updated, []);
assert.strictEqual(actual.remote, null); assert.strictEqual(actual.remote, null);
}); });
@ -239,9 +239,9 @@ suite('ExtensionsMerge', () => {
const actual = merge(localExtensions, remoteExtensions, baseExtensions, skippedExtensions, []); const actual = merge(localExtensions, remoteExtensions, baseExtensions, skippedExtensions, []);
assert.deepEqual(actual.added, [{ identifier: { id: 'b', uuid: 'b' }, installed: true, version: '1.0.0' }, { identifier: { id: 'c', uuid: 'c' }, installed: true, version: '1.0.0' }]); assert.deepStrictEqual(actual.added, [{ identifier: { id: 'b', uuid: 'b' }, installed: true, version: '1.0.0' }, { identifier: { id: 'c', uuid: 'c' }, installed: true, version: '1.0.0' }]);
assert.deepEqual(actual.removed, [{ id: 'd', uuid: 'd' }]); assert.deepStrictEqual(actual.removed, [{ id: 'd', uuid: 'd' }]);
assert.deepEqual(actual.updated, []); assert.deepStrictEqual(actual.updated, []);
assert.strictEqual(actual.remote, null); assert.strictEqual(actual.remote, null);
}); });
@ -263,9 +263,9 @@ suite('ExtensionsMerge', () => {
const actual = merge(localExtensions, remoteExtensions, baseExtensions, skippedExtensions, ['b']); const actual = merge(localExtensions, remoteExtensions, baseExtensions, skippedExtensions, ['b']);
assert.deepEqual(actual.added, [{ identifier: { id: 'c', uuid: 'c' }, installed: true, version: '1.0.0' }]); assert.deepStrictEqual(actual.added, [{ identifier: { id: 'c', uuid: 'c' }, installed: true, version: '1.0.0' }]);
assert.deepEqual(actual.removed, [{ id: 'd', uuid: 'd' }]); assert.deepStrictEqual(actual.removed, [{ id: 'd', uuid: 'd' }]);
assert.deepEqual(actual.updated, []); assert.deepStrictEqual(actual.updated, []);
assert.strictEqual(actual.remote, null); assert.strictEqual(actual.remote, null);
}); });
@ -285,10 +285,10 @@ suite('ExtensionsMerge', () => {
const actual = merge(localExtensions, remoteExtensions, baseExtensions, [], []); const actual = merge(localExtensions, remoteExtensions, baseExtensions, [], []);
assert.deepEqual(actual.added, []); assert.deepStrictEqual(actual.added, []);
assert.deepEqual(actual.removed, []); assert.deepStrictEqual(actual.removed, []);
assert.deepEqual(actual.updated, []); assert.deepStrictEqual(actual.updated, []);
assert.deepEqual(actual.remote, localExtensions); assert.deepStrictEqual(actual.remote, localExtensions);
}); });
test('merge local and remote extensions when local is moved forwarded with disabled extensions', () => { test('merge local and remote extensions when local is moved forwarded with disabled extensions', () => {
@ -308,10 +308,10 @@ suite('ExtensionsMerge', () => {
const actual = merge(localExtensions, remoteExtensions, baseExtensions, [], []); const actual = merge(localExtensions, remoteExtensions, baseExtensions, [], []);
assert.deepEqual(actual.added, []); assert.deepStrictEqual(actual.added, []);
assert.deepEqual(actual.removed, []); assert.deepStrictEqual(actual.removed, []);
assert.deepEqual(actual.updated, []); assert.deepStrictEqual(actual.updated, []);
assert.deepEqual(actual.remote, localExtensions); assert.deepStrictEqual(actual.remote, localExtensions);
}); });
test('merge local and remote extensions when local is moved forwarded with ignored settings', () => { test('merge local and remote extensions when local is moved forwarded with ignored settings', () => {
@ -330,10 +330,10 @@ suite('ExtensionsMerge', () => {
const actual = merge(localExtensions, remoteExtensions, baseExtensions, [], ['b']); const actual = merge(localExtensions, remoteExtensions, baseExtensions, [], ['b']);
assert.deepEqual(actual.added, []); assert.deepStrictEqual(actual.added, []);
assert.deepEqual(actual.removed, []); assert.deepStrictEqual(actual.removed, []);
assert.deepEqual(actual.updated, []); assert.deepStrictEqual(actual.updated, []);
assert.deepEqual(actual.remote, [ assert.deepStrictEqual(actual.remote, [
{ identifier: { id: 'c', uuid: 'c' }, installed: true, version: '1.0.0' }, { identifier: { id: 'c', uuid: 'c' }, installed: true, version: '1.0.0' },
]); ]);
}); });
@ -362,10 +362,10 @@ suite('ExtensionsMerge', () => {
const actual = merge(localExtensions, remoteExtensions, baseExtensions, skippedExtensions, []); const actual = merge(localExtensions, remoteExtensions, baseExtensions, skippedExtensions, []);
assert.deepEqual(actual.added, []); assert.deepStrictEqual(actual.added, []);
assert.deepEqual(actual.removed, []); assert.deepStrictEqual(actual.removed, []);
assert.deepEqual(actual.updated, []); assert.deepStrictEqual(actual.updated, []);
assert.deepEqual(actual.remote, expected); assert.deepStrictEqual(actual.remote, expected);
}); });
test('merge local and remote extensions when local is moved forwarded with skipped and ignored extensions', () => { test('merge local and remote extensions when local is moved forwarded with skipped and ignored extensions', () => {
@ -391,10 +391,10 @@ suite('ExtensionsMerge', () => {
const actual = merge(localExtensions, remoteExtensions, baseExtensions, skippedExtensions, ['c']); const actual = merge(localExtensions, remoteExtensions, baseExtensions, skippedExtensions, ['c']);
assert.deepEqual(actual.added, []); assert.deepStrictEqual(actual.added, []);
assert.deepEqual(actual.removed, []); assert.deepStrictEqual(actual.removed, []);
assert.deepEqual(actual.updated, []); assert.deepStrictEqual(actual.updated, []);
assert.deepEqual(actual.remote, expected); assert.deepStrictEqual(actual.remote, expected);
}); });
test('merge local and remote extensions when both moved forwarded', () => { test('merge local and remote extensions when both moved forwarded', () => {
@ -420,10 +420,10 @@ suite('ExtensionsMerge', () => {
const actual = merge(localExtensions, remoteExtensions, baseExtensions, [], []); const actual = merge(localExtensions, remoteExtensions, baseExtensions, [], []);
assert.deepEqual(actual.added, [{ identifier: { id: 'e', uuid: 'e' }, installed: true, version: '1.0.0' }]); assert.deepStrictEqual(actual.added, [{ identifier: { id: 'e', uuid: 'e' }, installed: true, version: '1.0.0' }]);
assert.deepEqual(actual.removed, [{ id: 'a', uuid: 'a' }]); assert.deepStrictEqual(actual.removed, [{ id: 'a', uuid: 'a' }]);
assert.deepEqual(actual.updated, []); assert.deepStrictEqual(actual.updated, []);
assert.deepEqual(actual.remote, expected); assert.deepStrictEqual(actual.remote, expected);
}); });
test('merge local and remote extensions when both moved forwarded with ignored extensions', () => { test('merge local and remote extensions when both moved forwarded with ignored extensions', () => {
@ -449,10 +449,10 @@ suite('ExtensionsMerge', () => {
const actual = merge(localExtensions, remoteExtensions, baseExtensions, [], ['a', 'e']); const actual = merge(localExtensions, remoteExtensions, baseExtensions, [], ['a', 'e']);
assert.deepEqual(actual.added, []); assert.deepStrictEqual(actual.added, []);
assert.deepEqual(actual.removed, []); assert.deepStrictEqual(actual.removed, []);
assert.deepEqual(actual.updated, []); assert.deepStrictEqual(actual.updated, []);
assert.deepEqual(actual.remote, expected); assert.deepStrictEqual(actual.remote, expected);
}); });
test('merge local and remote extensions when both moved forwarded with skipped extensions', () => { test('merge local and remote extensions when both moved forwarded with skipped extensions', () => {
@ -480,10 +480,10 @@ suite('ExtensionsMerge', () => {
const actual = merge(localExtensions, remoteExtensions, baseExtensions, skippedExtensions, []); const actual = merge(localExtensions, remoteExtensions, baseExtensions, skippedExtensions, []);
assert.deepEqual(actual.added, [{ identifier: { id: 'e', uuid: 'e' }, installed: true, version: '1.0.0' }]); assert.deepStrictEqual(actual.added, [{ identifier: { id: 'e', uuid: 'e' }, installed: true, version: '1.0.0' }]);
assert.deepEqual(actual.removed, []); assert.deepStrictEqual(actual.removed, []);
assert.deepEqual(actual.updated, []); assert.deepStrictEqual(actual.updated, []);
assert.deepEqual(actual.remote, expected); assert.deepStrictEqual(actual.remote, expected);
}); });
test('merge local and remote extensions when both moved forwarded with skipped and ignoredextensions', () => { test('merge local and remote extensions when both moved forwarded with skipped and ignoredextensions', () => {
@ -511,10 +511,10 @@ suite('ExtensionsMerge', () => {
const actual = merge(localExtensions, remoteExtensions, baseExtensions, skippedExtensions, ['e']); const actual = merge(localExtensions, remoteExtensions, baseExtensions, skippedExtensions, ['e']);
assert.deepEqual(actual.added, []); assert.deepStrictEqual(actual.added, []);
assert.deepEqual(actual.removed, []); assert.deepStrictEqual(actual.removed, []);
assert.deepEqual(actual.updated, []); assert.deepStrictEqual(actual.updated, []);
assert.deepEqual(actual.remote, expected); assert.deepStrictEqual(actual.remote, expected);
}); });
test('merge when remote extension has no uuid and different extension id case', () => { test('merge when remote extension has no uuid and different extension id case', () => {
@ -536,10 +536,10 @@ suite('ExtensionsMerge', () => {
const actual = merge(localExtensions, remoteExtensions, null, [], []); const actual = merge(localExtensions, remoteExtensions, null, [], []);
assert.deepEqual(actual.added, [{ identifier: { id: 'd', uuid: 'd' }, installed: true, version: '1.0.0' }]); assert.deepStrictEqual(actual.added, [{ identifier: { id: 'd', uuid: 'd' }, installed: true, version: '1.0.0' }]);
assert.deepEqual(actual.removed, []); assert.deepStrictEqual(actual.removed, []);
assert.deepEqual(actual.updated, []); assert.deepStrictEqual(actual.updated, []);
assert.deepEqual(actual.remote, expected); assert.deepStrictEqual(actual.remote, expected);
}); });
test('merge when remote extension is not an installed extension', () => { test('merge when remote extension is not an installed extension', () => {
@ -553,10 +553,10 @@ suite('ExtensionsMerge', () => {
const actual = merge(localExtensions, remoteExtensions, null, [], []); const actual = merge(localExtensions, remoteExtensions, null, [], []);
assert.deepEqual(actual.added, []); assert.deepStrictEqual(actual.added, []);
assert.deepEqual(actual.removed, []); assert.deepStrictEqual(actual.removed, []);
assert.deepEqual(actual.updated, []); assert.deepStrictEqual(actual.updated, []);
assert.deepEqual(actual.remote, null); assert.deepStrictEqual(actual.remote, null);
}); });
test('merge when remote extension is not an installed extension but is an installed extension locally', () => { test('merge when remote extension is not an installed extension but is an installed extension locally', () => {
@ -569,10 +569,10 @@ suite('ExtensionsMerge', () => {
const actual = merge(localExtensions, remoteExtensions, null, [], []); const actual = merge(localExtensions, remoteExtensions, null, [], []);
assert.deepEqual(actual.added, []); assert.deepStrictEqual(actual.added, []);
assert.deepEqual(actual.removed, []); assert.deepStrictEqual(actual.removed, []);
assert.deepEqual(actual.updated, []); assert.deepStrictEqual(actual.updated, []);
assert.deepEqual(actual.remote, localExtensions); assert.deepStrictEqual(actual.remote, localExtensions);
}); });
test('merge when an extension is not an installed extension remotely and does not exist locally', () => { test('merge when an extension is not an installed extension remotely and does not exist locally', () => {
@ -586,10 +586,10 @@ suite('ExtensionsMerge', () => {
const actual = merge(localExtensions, remoteExtensions, remoteExtensions, [], []); const actual = merge(localExtensions, remoteExtensions, remoteExtensions, [], []);
assert.deepEqual(actual.added, []); assert.deepStrictEqual(actual.added, []);
assert.deepEqual(actual.removed, []); assert.deepStrictEqual(actual.removed, []);
assert.deepEqual(actual.updated, []); assert.deepStrictEqual(actual.updated, []);
assert.deepEqual(actual.remote, null); assert.deepStrictEqual(actual.remote, null);
}); });
test('merge when an extension is an installed extension remotely but not locally and updated locally', () => { test('merge when an extension is an installed extension remotely but not locally and updated locally', () => {
@ -605,10 +605,10 @@ suite('ExtensionsMerge', () => {
const actual = merge(localExtensions, remoteExtensions, remoteExtensions, [], []); const actual = merge(localExtensions, remoteExtensions, remoteExtensions, [], []);
assert.deepEqual(actual.added, []); assert.deepStrictEqual(actual.added, []);
assert.deepEqual(actual.removed, []); assert.deepStrictEqual(actual.removed, []);
assert.deepEqual(actual.updated, []); assert.deepStrictEqual(actual.updated, []);
assert.deepEqual(actual.remote, expected); assert.deepStrictEqual(actual.remote, expected);
}); });
test('merge when an extension is an installed extension remotely but not locally and updated remotely', () => { test('merge when an extension is an installed extension remotely but not locally and updated remotely', () => {
@ -621,10 +621,10 @@ suite('ExtensionsMerge', () => {
const actual = merge(localExtensions, remoteExtensions, localExtensions, [], []); const actual = merge(localExtensions, remoteExtensions, localExtensions, [], []);
assert.deepEqual(actual.added, []); assert.deepStrictEqual(actual.added, []);
assert.deepEqual(actual.removed, []); assert.deepStrictEqual(actual.removed, []);
assert.deepEqual(actual.updated, remoteExtensions); assert.deepStrictEqual(actual.updated, remoteExtensions);
assert.deepEqual(actual.remote, null); assert.deepStrictEqual(actual.remote, null);
}); });
test('merge not installed extensions', () => { test('merge not installed extensions', () => {
@ -641,10 +641,10 @@ suite('ExtensionsMerge', () => {
const actual = merge(localExtensions, remoteExtensions, null, [], []); const actual = merge(localExtensions, remoteExtensions, null, [], []);
assert.deepEqual(actual.added, []); assert.deepStrictEqual(actual.added, []);
assert.deepEqual(actual.removed, []); assert.deepStrictEqual(actual.removed, []);
assert.deepEqual(actual.updated, []); assert.deepStrictEqual(actual.updated, []);
assert.deepEqual(actual.remote, expected); assert.deepStrictEqual(actual.remote, expected);
}); });
}); });

View file

@ -15,10 +15,10 @@ suite('GlobalStateMerge', () => {
const actual = merge(local, remote, null, { machine: [], unregistered: [] }, new NullLogService()); const actual = merge(local, remote, null, { machine: [], unregistered: [] }, new NullLogService());
assert.deepEqual(actual.local.added, {}); assert.deepStrictEqual(actual.local.added, {});
assert.deepEqual(actual.local.updated, {}); assert.deepStrictEqual(actual.local.updated, {});
assert.deepEqual(actual.local.removed, []); assert.deepStrictEqual(actual.local.removed, []);
assert.deepEqual(actual.remote, null); assert.deepStrictEqual(actual.remote, null);
}); });
test('merge when local and remote are same with multiple entries and local is not synced yet', async () => { test('merge when local and remote are same with multiple entries and local is not synced yet', async () => {
@ -27,10 +27,10 @@ suite('GlobalStateMerge', () => {
const actual = merge(local, remote, null, { machine: [], unregistered: [] }, new NullLogService()); const actual = merge(local, remote, null, { machine: [], unregistered: [] }, new NullLogService());
assert.deepEqual(actual.local.added, {}); assert.deepStrictEqual(actual.local.added, {});
assert.deepEqual(actual.local.updated, {}); assert.deepStrictEqual(actual.local.updated, {});
assert.deepEqual(actual.local.removed, []); assert.deepStrictEqual(actual.local.removed, []);
assert.deepEqual(actual.remote, null); assert.deepStrictEqual(actual.remote, null);
}); });
test('merge when local and remote are same with multiple entries in different order and local is not synced yet', async () => { test('merge when local and remote are same with multiple entries in different order and local is not synced yet', async () => {
@ -39,10 +39,10 @@ suite('GlobalStateMerge', () => {
const actual = merge(local, remote, null, { machine: [], unregistered: [] }, new NullLogService()); const actual = merge(local, remote, null, { machine: [], unregistered: [] }, new NullLogService());
assert.deepEqual(actual.local.added, {}); assert.deepStrictEqual(actual.local.added, {});
assert.deepEqual(actual.local.updated, {}); assert.deepStrictEqual(actual.local.updated, {});
assert.deepEqual(actual.local.removed, []); assert.deepStrictEqual(actual.local.removed, []);
assert.deepEqual(actual.remote, null); assert.deepStrictEqual(actual.remote, null);
}); });
test('merge when local and remote are same with different base content', async () => { test('merge when local and remote are same with different base content', async () => {
@ -52,10 +52,10 @@ suite('GlobalStateMerge', () => {
const actual = merge(local, remote, base, { machine: [], unregistered: [] }, new NullLogService()); const actual = merge(local, remote, base, { machine: [], unregistered: [] }, new NullLogService());
assert.deepEqual(actual.local.added, {}); assert.deepStrictEqual(actual.local.added, {});
assert.deepEqual(actual.local.updated, {}); assert.deepStrictEqual(actual.local.updated, {});
assert.deepEqual(actual.local.removed, []); assert.deepStrictEqual(actual.local.removed, []);
assert.deepEqual(actual.remote, null); assert.deepStrictEqual(actual.remote, null);
}); });
test('merge when a new entry is added to remote and local has not synced yet', async () => { test('merge when a new entry is added to remote and local has not synced yet', async () => {
@ -64,10 +64,10 @@ suite('GlobalStateMerge', () => {
const actual = merge(local, remote, null, { machine: [], unregistered: [] }, new NullLogService()); const actual = merge(local, remote, null, { machine: [], unregistered: [] }, new NullLogService());
assert.deepEqual(actual.local.added, { 'b': { version: 1, value: 'b' } }); assert.deepStrictEqual(actual.local.added, { 'b': { version: 1, value: 'b' } });
assert.deepEqual(actual.local.updated, {}); assert.deepStrictEqual(actual.local.updated, {});
assert.deepEqual(actual.local.removed, []); assert.deepStrictEqual(actual.local.removed, []);
assert.deepEqual(actual.remote, null); assert.deepStrictEqual(actual.remote, null);
}); });
test('merge when multiple new entries are added to remote and local is not synced yet', async () => { test('merge when multiple new entries are added to remote and local is not synced yet', async () => {
@ -76,10 +76,10 @@ suite('GlobalStateMerge', () => {
const actual = merge(local, remote, null, { machine: [], unregistered: [] }, new NullLogService()); const actual = merge(local, remote, null, { machine: [], unregistered: [] }, new NullLogService());
assert.deepEqual(actual.local.added, { 'b': { version: 1, value: 'b' }, 'a': { version: 1, value: 'a' } }); assert.deepStrictEqual(actual.local.added, { 'b': { version: 1, value: 'b' }, 'a': { version: 1, value: 'a' } });
assert.deepEqual(actual.local.updated, {}); assert.deepStrictEqual(actual.local.updated, {});
assert.deepEqual(actual.local.removed, []); assert.deepStrictEqual(actual.local.removed, []);
assert.deepEqual(actual.remote, null); assert.deepStrictEqual(actual.remote, null);
}); });
test('merge when new entry is added to remote from base and local has not changed', async () => { test('merge when new entry is added to remote from base and local has not changed', async () => {
@ -88,10 +88,10 @@ suite('GlobalStateMerge', () => {
const actual = merge(local, remote, local, { machine: [], unregistered: [] }, new NullLogService()); const actual = merge(local, remote, local, { machine: [], unregistered: [] }, new NullLogService());
assert.deepEqual(actual.local.added, { 'b': { version: 1, value: 'b' } }); assert.deepStrictEqual(actual.local.added, { 'b': { version: 1, value: 'b' } });
assert.deepEqual(actual.local.updated, {}); assert.deepStrictEqual(actual.local.updated, {});
assert.deepEqual(actual.local.removed, []); assert.deepStrictEqual(actual.local.removed, []);
assert.deepEqual(actual.remote, null); assert.deepStrictEqual(actual.remote, null);
}); });
test('merge when an entry is removed from remote from base and local has not changed', async () => { test('merge when an entry is removed from remote from base and local has not changed', async () => {
@ -100,10 +100,10 @@ suite('GlobalStateMerge', () => {
const actual = merge(local, remote, local, { machine: [], unregistered: [] }, new NullLogService()); const actual = merge(local, remote, local, { machine: [], unregistered: [] }, new NullLogService());
assert.deepEqual(actual.local.added, {}); assert.deepStrictEqual(actual.local.added, {});
assert.deepEqual(actual.local.updated, {}); assert.deepStrictEqual(actual.local.updated, {});
assert.deepEqual(actual.local.removed, ['b']); assert.deepStrictEqual(actual.local.removed, ['b']);
assert.deepEqual(actual.remote, null); assert.deepStrictEqual(actual.remote, null);
}); });
test('merge when all entries are removed from base and local has not changed', async () => { test('merge when all entries are removed from base and local has not changed', async () => {
@ -112,10 +112,10 @@ suite('GlobalStateMerge', () => {
const actual = merge(local, remote, local, { machine: [], unregistered: [] }, new NullLogService()); const actual = merge(local, remote, local, { machine: [], unregistered: [] }, new NullLogService());
assert.deepEqual(actual.local.added, {}); assert.deepStrictEqual(actual.local.added, {});
assert.deepEqual(actual.local.updated, {}); assert.deepStrictEqual(actual.local.updated, {});
assert.deepEqual(actual.local.removed, ['b', 'a']); assert.deepStrictEqual(actual.local.removed, ['b', 'a']);
assert.deepEqual(actual.remote, null); assert.deepStrictEqual(actual.remote, null);
}); });
test('merge when an entry is updated in remote from base and local has not changed', async () => { test('merge when an entry is updated in remote from base and local has not changed', async () => {
@ -124,10 +124,10 @@ suite('GlobalStateMerge', () => {
const actual = merge(local, remote, local, { machine: [], unregistered: [] }, new NullLogService()); const actual = merge(local, remote, local, { machine: [], unregistered: [] }, new NullLogService());
assert.deepEqual(actual.local.added, {}); assert.deepStrictEqual(actual.local.added, {});
assert.deepEqual(actual.local.updated, { 'a': { version: 1, value: 'b' } }); assert.deepStrictEqual(actual.local.updated, { 'a': { version: 1, value: 'b' } });
assert.deepEqual(actual.local.removed, []); assert.deepStrictEqual(actual.local.removed, []);
assert.deepEqual(actual.remote, null); assert.deepStrictEqual(actual.remote, null);
}); });
test('merge when remote has moved forwarded with multiple changes and local stays with base', async () => { test('merge when remote has moved forwarded with multiple changes and local stays with base', async () => {
@ -136,10 +136,10 @@ suite('GlobalStateMerge', () => {
const actual = merge(local, remote, local, { machine: [], unregistered: [] }, new NullLogService()); const actual = merge(local, remote, local, { machine: [], unregistered: [] }, new NullLogService());
assert.deepEqual(actual.local.added, { 'c': { version: 1, value: 'c' } }); assert.deepStrictEqual(actual.local.added, { 'c': { version: 1, value: 'c' } });
assert.deepEqual(actual.local.updated, { 'a': { version: 1, value: 'd' } }); assert.deepStrictEqual(actual.local.updated, { 'a': { version: 1, value: 'd' } });
assert.deepEqual(actual.local.removed, ['b']); assert.deepStrictEqual(actual.local.removed, ['b']);
assert.deepEqual(actual.remote, null); assert.deepStrictEqual(actual.remote, null);
}); });
test('merge when new entries are added to local and local is not synced yet', async () => { test('merge when new entries are added to local and local is not synced yet', async () => {
@ -148,10 +148,10 @@ suite('GlobalStateMerge', () => {
const actual = merge(local, remote, null, { machine: [], unregistered: [] }, new NullLogService()); const actual = merge(local, remote, null, { machine: [], unregistered: [] }, new NullLogService());
assert.deepEqual(actual.local.added, {}); assert.deepStrictEqual(actual.local.added, {});
assert.deepEqual(actual.local.updated, {}); assert.deepStrictEqual(actual.local.updated, {});
assert.deepEqual(actual.local.removed, []); assert.deepStrictEqual(actual.local.removed, []);
assert.deepEqual(actual.remote, local); assert.deepStrictEqual(actual.remote, local);
}); });
test('merge when multiple new entries are added to local from base and remote is not changed', async () => { test('merge when multiple new entries are added to local from base and remote is not changed', async () => {
@ -160,10 +160,10 @@ suite('GlobalStateMerge', () => {
const actual = merge(local, remote, remote, { machine: [], unregistered: [] }, new NullLogService()); const actual = merge(local, remote, remote, { machine: [], unregistered: [] }, new NullLogService());
assert.deepEqual(actual.local.added, {}); assert.deepStrictEqual(actual.local.added, {});
assert.deepEqual(actual.local.updated, {}); assert.deepStrictEqual(actual.local.updated, {});
assert.deepEqual(actual.local.removed, []); assert.deepStrictEqual(actual.local.removed, []);
assert.deepEqual(actual.remote, local); assert.deepStrictEqual(actual.remote, local);
}); });
test('merge when an entry is removed from local from base and remote has not changed', async () => { test('merge when an entry is removed from local from base and remote has not changed', async () => {
@ -172,10 +172,10 @@ suite('GlobalStateMerge', () => {
const actual = merge(local, remote, remote, { machine: [], unregistered: [] }, new NullLogService()); const actual = merge(local, remote, remote, { machine: [], unregistered: [] }, new NullLogService());
assert.deepEqual(actual.local.added, {}); assert.deepStrictEqual(actual.local.added, {});
assert.deepEqual(actual.local.updated, {}); assert.deepStrictEqual(actual.local.updated, {});
assert.deepEqual(actual.local.removed, []); assert.deepStrictEqual(actual.local.removed, []);
assert.deepEqual(actual.remote, local); assert.deepStrictEqual(actual.remote, local);
}); });
test('merge when an entry is updated in local from base and remote has not changed', async () => { test('merge when an entry is updated in local from base and remote has not changed', async () => {
@ -184,10 +184,10 @@ suite('GlobalStateMerge', () => {
const actual = merge(local, remote, remote, { machine: [], unregistered: [] }, new NullLogService()); const actual = merge(local, remote, remote, { machine: [], unregistered: [] }, new NullLogService());
assert.deepEqual(actual.local.added, {}); assert.deepStrictEqual(actual.local.added, {});
assert.deepEqual(actual.local.updated, {}); assert.deepStrictEqual(actual.local.updated, {});
assert.deepEqual(actual.local.removed, []); assert.deepStrictEqual(actual.local.removed, []);
assert.deepEqual(actual.remote, local); assert.deepStrictEqual(actual.remote, local);
}); });
test('merge when local has moved forwarded with multiple changes and remote stays with base', async () => { test('merge when local has moved forwarded with multiple changes and remote stays with base', async () => {
@ -196,10 +196,10 @@ suite('GlobalStateMerge', () => {
const actual = merge(local, remote, remote, { machine: [], unregistered: [] }, new NullLogService()); const actual = merge(local, remote, remote, { machine: [], unregistered: [] }, new NullLogService());
assert.deepEqual(actual.local.added, {}); assert.deepStrictEqual(actual.local.added, {});
assert.deepEqual(actual.local.updated, {}); assert.deepStrictEqual(actual.local.updated, {});
assert.deepEqual(actual.local.removed, []); assert.deepStrictEqual(actual.local.removed, []);
assert.deepEqual(actual.remote, local); assert.deepStrictEqual(actual.remote, local);
}); });
test('merge when local and remote with one entry but different value and local is not synced yet', async () => { test('merge when local and remote with one entry but different value and local is not synced yet', async () => {
@ -208,10 +208,10 @@ suite('GlobalStateMerge', () => {
const actual = merge(local, remote, null, { machine: [], unregistered: [] }, new NullLogService()); const actual = merge(local, remote, null, { machine: [], unregistered: [] }, new NullLogService());
assert.deepEqual(actual.local.added, {}); assert.deepStrictEqual(actual.local.added, {});
assert.deepEqual(actual.local.updated, { 'a': { version: 1, value: 'b' } }); assert.deepStrictEqual(actual.local.updated, { 'a': { version: 1, value: 'b' } });
assert.deepEqual(actual.local.removed, []); assert.deepStrictEqual(actual.local.removed, []);
assert.deepEqual(actual.remote, null); assert.deepStrictEqual(actual.remote, null);
}); });
test('merge when the entry is removed in remote but updated in local and a new entry is added in remote', async () => { test('merge when the entry is removed in remote but updated in local and a new entry is added in remote', async () => {
@ -221,10 +221,10 @@ suite('GlobalStateMerge', () => {
const actual = merge(local, remote, base, { machine: [], unregistered: [] }, new NullLogService()); const actual = merge(local, remote, base, { machine: [], unregistered: [] }, new NullLogService());
assert.deepEqual(actual.local.added, { 'c': { version: 1, value: 'c' } }); assert.deepStrictEqual(actual.local.added, { 'c': { version: 1, value: 'c' } });
assert.deepEqual(actual.local.updated, {}); assert.deepStrictEqual(actual.local.updated, {});
assert.deepEqual(actual.local.removed, []); assert.deepStrictEqual(actual.local.removed, []);
assert.deepEqual(actual.remote, { 'a': { version: 1, value: 'a' }, 'c': { version: 1, value: 'c' }, 'b': { version: 1, value: 'd' } }); assert.deepStrictEqual(actual.remote, { 'a': { version: 1, value: 'a' }, 'c': { version: 1, value: 'c' }, 'b': { version: 1, value: 'd' } });
}); });
test('merge with single entry and local is empty', async () => { test('merge with single entry and local is empty', async () => {
@ -234,10 +234,10 @@ suite('GlobalStateMerge', () => {
const actual = merge(local, remote, base, { machine: [], unregistered: [] }, new NullLogService()); const actual = merge(local, remote, base, { machine: [], unregistered: [] }, new NullLogService());
assert.deepEqual(actual.local.added, {}); assert.deepStrictEqual(actual.local.added, {});
assert.deepEqual(actual.local.updated, {}); assert.deepStrictEqual(actual.local.updated, {});
assert.deepEqual(actual.local.removed, []); assert.deepStrictEqual(actual.local.removed, []);
assert.deepEqual(actual.remote, local); assert.deepStrictEqual(actual.remote, local);
}); });
test('merge when local and remote has moved forward with conflicts', async () => { test('merge when local and remote has moved forward with conflicts', async () => {
@ -247,10 +247,10 @@ suite('GlobalStateMerge', () => {
const actual = merge(local, remote, base, { machine: [], unregistered: [] }, new NullLogService()); const actual = merge(local, remote, base, { machine: [], unregistered: [] }, new NullLogService());
assert.deepEqual(actual.local.added, {}); assert.deepStrictEqual(actual.local.added, {});
assert.deepEqual(actual.local.updated, {}); assert.deepStrictEqual(actual.local.updated, {});
assert.deepEqual(actual.local.removed, []); assert.deepStrictEqual(actual.local.removed, []);
assert.deepEqual(actual.remote, local); assert.deepStrictEqual(actual.remote, local);
}); });
test('merge when a new entry is added to remote but scoped to machine locally and local is not synced yet', async () => { test('merge when a new entry is added to remote but scoped to machine locally and local is not synced yet', async () => {
@ -259,10 +259,10 @@ suite('GlobalStateMerge', () => {
const actual = merge(local, remote, null, { machine: ['b'], unregistered: [] }, new NullLogService()); const actual = merge(local, remote, null, { machine: ['b'], unregistered: [] }, new NullLogService());
assert.deepEqual(actual.local.added, {}); assert.deepStrictEqual(actual.local.added, {});
assert.deepEqual(actual.local.updated, {}); assert.deepStrictEqual(actual.local.updated, {});
assert.deepEqual(actual.local.removed, []); assert.deepStrictEqual(actual.local.removed, []);
assert.deepEqual(actual.remote, null); assert.deepStrictEqual(actual.remote, null);
}); });
test('merge when an entry is updated to remote but scoped to machine locally', async () => { test('merge when an entry is updated to remote but scoped to machine locally', async () => {
@ -271,10 +271,10 @@ suite('GlobalStateMerge', () => {
const actual = merge(local, remote, local, { machine: ['a'], unregistered: [] }, new NullLogService()); const actual = merge(local, remote, local, { machine: ['a'], unregistered: [] }, new NullLogService());
assert.deepEqual(actual.local.added, {}); assert.deepStrictEqual(actual.local.added, {});
assert.deepEqual(actual.local.updated, {}); assert.deepStrictEqual(actual.local.updated, {});
assert.deepEqual(actual.local.removed, []); assert.deepStrictEqual(actual.local.removed, []);
assert.deepEqual(actual.remote, null); assert.deepStrictEqual(actual.remote, null);
}); });
test('merge when a local value is removed and scoped to machine locally', async () => { test('merge when a local value is removed and scoped to machine locally', async () => {
@ -284,10 +284,10 @@ suite('GlobalStateMerge', () => {
const actual = merge(local, remote, base, { machine: ['b'], unregistered: [] }, new NullLogService()); const actual = merge(local, remote, base, { machine: ['b'], unregistered: [] }, new NullLogService());
assert.deepEqual(actual.local.added, {}); assert.deepStrictEqual(actual.local.added, {});
assert.deepEqual(actual.local.updated, {}); assert.deepStrictEqual(actual.local.updated, {});
assert.deepEqual(actual.local.removed, []); assert.deepStrictEqual(actual.local.removed, []);
assert.deepEqual(actual.remote, local); assert.deepStrictEqual(actual.remote, local);
}); });
test('merge when local moved forwared by changing a key to machine scope', async () => { test('merge when local moved forwared by changing a key to machine scope', async () => {
@ -297,10 +297,10 @@ suite('GlobalStateMerge', () => {
const actual = merge(local, remote, base, { machine: ['b'], unregistered: [] }, new NullLogService()); const actual = merge(local, remote, base, { machine: ['b'], unregistered: [] }, new NullLogService());
assert.deepEqual(actual.local.added, {}); assert.deepStrictEqual(actual.local.added, {});
assert.deepEqual(actual.local.updated, {}); assert.deepStrictEqual(actual.local.updated, {});
assert.deepEqual(actual.local.removed, []); assert.deepStrictEqual(actual.local.removed, []);
assert.deepEqual(actual.remote, local); assert.deepStrictEqual(actual.remote, local);
}); });
test('merge should not remove remote keys if not registered', async () => { test('merge should not remove remote keys if not registered', async () => {
@ -310,10 +310,10 @@ suite('GlobalStateMerge', () => {
const actual = merge(local, remote, base, { machine: [], unregistered: ['c'] }, new NullLogService()); const actual = merge(local, remote, base, { machine: [], unregistered: ['c'] }, new NullLogService());
assert.deepEqual(actual.local.added, {}); assert.deepStrictEqual(actual.local.added, {});
assert.deepEqual(actual.local.updated, {}); assert.deepStrictEqual(actual.local.updated, {});
assert.deepEqual(actual.local.removed, []); assert.deepStrictEqual(actual.local.removed, []);
assert.deepEqual(actual.remote, { 'a': { version: 1, value: 'a' }, 'b': { version: 1, value: 'b' }, 'c': { version: 1, value: 'c' } }); assert.deepStrictEqual(actual.remote, { 'a': { version: 1, value: 'a' }, 'b': { version: 1, value: 'b' }, 'c': { version: 1, value: 'c' } });
}); });
}); });

View file

@ -37,30 +37,30 @@ suite('GlobalStateSync', () => {
teardown(() => disposableStore.clear()); teardown(() => disposableStore.clear());
test('when global state does not exist', async () => { test('when global state does not exist', async () => {
assert.deepEqual(await testObject.getLastSyncUserData(), null); assert.deepStrictEqual(await testObject.getLastSyncUserData(), null);
let manifest = await testClient.manifest(); let manifest = await testClient.manifest();
server.reset(); server.reset();
await testObject.sync(manifest); await testObject.sync(manifest);
assert.deepEqual(server.requests, [ assert.deepStrictEqual(server.requests, [
{ type: 'GET', url: `${server.url}/v1/resource/${testObject.resource}/latest`, headers: {} }, { type: 'GET', url: `${server.url}/v1/resource/${testObject.resource}/latest`, headers: {} },
]); ]);
const lastSyncUserData = await testObject.getLastSyncUserData(); const lastSyncUserData = await testObject.getLastSyncUserData();
const remoteUserData = await testObject.getRemoteUserData(null); const remoteUserData = await testObject.getRemoteUserData(null);
assert.deepEqual(lastSyncUserData!.ref, remoteUserData.ref); assert.deepStrictEqual(lastSyncUserData!.ref, remoteUserData.ref);
assert.deepEqual(lastSyncUserData!.syncData, remoteUserData.syncData); assert.deepStrictEqual(lastSyncUserData!.syncData, remoteUserData.syncData);
assert.strictEqual(lastSyncUserData!.syncData, null); assert.strictEqual(lastSyncUserData!.syncData, null);
manifest = await testClient.manifest(); manifest = await testClient.manifest();
server.reset(); server.reset();
await testObject.sync(manifest); await testObject.sync(manifest);
assert.deepEqual(server.requests, []); assert.deepStrictEqual(server.requests, []);
manifest = await testClient.manifest(); manifest = await testClient.manifest();
server.reset(); server.reset();
await testObject.sync(manifest); await testObject.sync(manifest);
assert.deepEqual(server.requests, []); assert.deepStrictEqual(server.requests, []);
}); });
test('when global state is created after first sync', async () => { test('when global state is created after first sync', async () => {
@ -72,15 +72,15 @@ suite('GlobalStateSync', () => {
server.reset(); server.reset();
await testObject.sync(manifest); await testObject.sync(manifest);
assert.deepEqual(server.requests, [ assert.deepStrictEqual(server.requests, [
{ type: 'POST', url: `${server.url}/v1/resource/${testObject.resource}`, headers: { 'If-Match': lastSyncUserData?.ref } }, { type: 'POST', url: `${server.url}/v1/resource/${testObject.resource}`, headers: { 'If-Match': lastSyncUserData?.ref } },
]); ]);
lastSyncUserData = await testObject.getLastSyncUserData(); lastSyncUserData = await testObject.getLastSyncUserData();
const remoteUserData = await testObject.getRemoteUserData(null); const remoteUserData = await testObject.getRemoteUserData(null);
assert.deepEqual(lastSyncUserData!.ref, remoteUserData.ref); assert.deepStrictEqual(lastSyncUserData!.ref, remoteUserData.ref);
assert.deepEqual(lastSyncUserData!.syncData, remoteUserData.syncData); assert.deepStrictEqual(lastSyncUserData!.syncData, remoteUserData.syncData);
assert.deepEqual(JSON.parse(lastSyncUserData!.syncData!.content).storage, { 'a': { version: 1, value: 'value1' } }); assert.deepStrictEqual(JSON.parse(lastSyncUserData!.syncData!.content).storage, { 'a': { version: 1, value: 'value1' } });
}); });
test('first time sync - outgoing to server (no state)', async () => { test('first time sync - outgoing to server (no state)', async () => {
@ -90,12 +90,12 @@ suite('GlobalStateSync', () => {
await testObject.sync(await testClient.manifest()); await testObject.sync(await testClient.manifest());
assert.strictEqual(testObject.status, SyncStatus.Idle); assert.strictEqual(testObject.status, SyncStatus.Idle);
assert.deepEqual(testObject.conflicts, []); assert.deepStrictEqual(testObject.conflicts, []);
const { content } = await testClient.read(testObject.resource); const { content } = await testClient.read(testObject.resource);
assert.ok(content !== null); assert.ok(content !== null);
const actual = parseGlobalState(content!); const actual = parseGlobalState(content!);
assert.deepEqual(actual.storage, { 'globalState.argv.locale': { version: 1, value: 'en' }, 'a': { version: 1, value: 'value1' } }); assert.deepStrictEqual(actual.storage, { 'globalState.argv.locale': { version: 1, value: 'en' }, 'a': { version: 1, value: 'value1' } });
}); });
test('first time sync - incoming from server (no state)', async () => { test('first time sync - incoming from server (no state)', async () => {
@ -105,7 +105,7 @@ suite('GlobalStateSync', () => {
await testObject.sync(await testClient.manifest()); await testObject.sync(await testClient.manifest());
assert.strictEqual(testObject.status, SyncStatus.Idle); assert.strictEqual(testObject.status, SyncStatus.Idle);
assert.deepEqual(testObject.conflicts, []); assert.deepStrictEqual(testObject.conflicts, []);
assert.strictEqual(readStorage('a', testClient), 'value1'); assert.strictEqual(readStorage('a', testClient), 'value1');
assert.strictEqual(await readLocale(testClient), 'en'); assert.strictEqual(await readLocale(testClient), 'en');
@ -118,7 +118,7 @@ suite('GlobalStateSync', () => {
updateUserStorage('b', 'value2', testClient); updateUserStorage('b', 'value2', testClient);
await testObject.sync(await testClient.manifest()); await testObject.sync(await testClient.manifest());
assert.strictEqual(testObject.status, SyncStatus.Idle); assert.strictEqual(testObject.status, SyncStatus.Idle);
assert.deepEqual(testObject.conflicts, []); assert.deepStrictEqual(testObject.conflicts, []);
assert.strictEqual(readStorage('a', testClient), 'value1'); assert.strictEqual(readStorage('a', testClient), 'value1');
assert.strictEqual(readStorage('b', testClient), 'value2'); assert.strictEqual(readStorage('b', testClient), 'value2');
@ -126,7 +126,7 @@ suite('GlobalStateSync', () => {
const { content } = await testClient.read(testObject.resource); const { content } = await testClient.read(testObject.resource);
assert.ok(content !== null); assert.ok(content !== null);
const actual = parseGlobalState(content!); const actual = parseGlobalState(content!);
assert.deepEqual(actual.storage, { 'a': { version: 1, value: 'value1' }, 'b': { version: 1, value: 'value2' } }); assert.deepStrictEqual(actual.storage, { 'a': { version: 1, value: 'value1' }, 'b': { version: 1, value: 'value2' } });
}); });
test('first time sync when storage exists - has conflicts', async () => { test('first time sync when storage exists - has conflicts', async () => {
@ -137,14 +137,14 @@ suite('GlobalStateSync', () => {
await testObject.sync(await testClient.manifest()); await testObject.sync(await testClient.manifest());
assert.strictEqual(testObject.status, SyncStatus.Idle); assert.strictEqual(testObject.status, SyncStatus.Idle);
assert.deepEqual(testObject.conflicts, []); assert.deepStrictEqual(testObject.conflicts, []);
assert.strictEqual(readStorage('a', testClient), 'value1'); assert.strictEqual(readStorage('a', testClient), 'value1');
const { content } = await testClient.read(testObject.resource); const { content } = await testClient.read(testObject.resource);
assert.ok(content !== null); assert.ok(content !== null);
const actual = parseGlobalState(content!); const actual = parseGlobalState(content!);
assert.deepEqual(actual.storage, { 'a': { version: 1, value: 'value1' } }); assert.deepStrictEqual(actual.storage, { 'a': { version: 1, value: 'value1' } });
}); });
test('sync adding a storage value', async () => { test('sync adding a storage value', async () => {
@ -154,7 +154,7 @@ suite('GlobalStateSync', () => {
updateUserStorage('b', 'value2', testClient); updateUserStorage('b', 'value2', testClient);
await testObject.sync(await testClient.manifest()); await testObject.sync(await testClient.manifest());
assert.strictEqual(testObject.status, SyncStatus.Idle); assert.strictEqual(testObject.status, SyncStatus.Idle);
assert.deepEqual(testObject.conflicts, []); assert.deepStrictEqual(testObject.conflicts, []);
assert.strictEqual(readStorage('a', testClient), 'value1'); assert.strictEqual(readStorage('a', testClient), 'value1');
assert.strictEqual(readStorage('b', testClient), 'value2'); assert.strictEqual(readStorage('b', testClient), 'value2');
@ -162,7 +162,7 @@ suite('GlobalStateSync', () => {
const { content } = await testClient.read(testObject.resource); const { content } = await testClient.read(testObject.resource);
assert.ok(content !== null); assert.ok(content !== null);
const actual = parseGlobalState(content!); const actual = parseGlobalState(content!);
assert.deepEqual(actual.storage, { 'a': { version: 1, value: 'value1' }, 'b': { version: 1, value: 'value2' } }); assert.deepStrictEqual(actual.storage, { 'a': { version: 1, value: 'value1' }, 'b': { version: 1, value: 'value2' } });
}); });
test('sync updating a storage value', async () => { test('sync updating a storage value', async () => {
@ -172,14 +172,14 @@ suite('GlobalStateSync', () => {
updateUserStorage('a', 'value2', testClient); updateUserStorage('a', 'value2', testClient);
await testObject.sync(await testClient.manifest()); await testObject.sync(await testClient.manifest());
assert.strictEqual(testObject.status, SyncStatus.Idle); assert.strictEqual(testObject.status, SyncStatus.Idle);
assert.deepEqual(testObject.conflicts, []); assert.deepStrictEqual(testObject.conflicts, []);
assert.strictEqual(readStorage('a', testClient), 'value2'); assert.strictEqual(readStorage('a', testClient), 'value2');
const { content } = await testClient.read(testObject.resource); const { content } = await testClient.read(testObject.resource);
assert.ok(content !== null); assert.ok(content !== null);
const actual = parseGlobalState(content!); const actual = parseGlobalState(content!);
assert.deepEqual(actual.storage, { 'a': { version: 1, value: 'value2' } }); assert.deepStrictEqual(actual.storage, { 'a': { version: 1, value: 'value2' } });
}); });
test('sync removing a storage value', async () => { test('sync removing a storage value', async () => {
@ -190,7 +190,7 @@ suite('GlobalStateSync', () => {
removeStorage('b', testClient); removeStorage('b', testClient);
await testObject.sync(await testClient.manifest()); await testObject.sync(await testClient.manifest());
assert.strictEqual(testObject.status, SyncStatus.Idle); assert.strictEqual(testObject.status, SyncStatus.Idle);
assert.deepEqual(testObject.conflicts, []); assert.deepStrictEqual(testObject.conflicts, []);
assert.strictEqual(readStorage('a', testClient), 'value1'); assert.strictEqual(readStorage('a', testClient), 'value1');
assert.strictEqual(readStorage('b', testClient), undefined); assert.strictEqual(readStorage('b', testClient), undefined);
@ -198,7 +198,7 @@ suite('GlobalStateSync', () => {
const { content } = await testClient.read(testObject.resource); const { content } = await testClient.read(testObject.resource);
assert.ok(content !== null); assert.ok(content !== null);
const actual = parseGlobalState(content!); const actual = parseGlobalState(content!);
assert.deepEqual(actual.storage, { 'a': { version: 1, value: 'value1' } }); assert.deepStrictEqual(actual.storage, { 'a': { version: 1, value: 'value1' } });
}); });
function parseGlobalState(content: string): IGlobalState { function parseGlobalState(content: string): IGlobalState {

View file

@ -34,31 +34,31 @@ suite('KeybindingsSync', () => {
const fileService = client.instantiationService.get(IFileService); const fileService = client.instantiationService.get(IFileService);
const keybindingsResource = client.instantiationService.get(IEnvironmentService).keybindingsResource; const keybindingsResource = client.instantiationService.get(IEnvironmentService).keybindingsResource;
assert.deepEqual(await testObject.getLastSyncUserData(), null); assert.deepStrictEqual(await testObject.getLastSyncUserData(), null);
let manifest = await client.manifest(); let manifest = await client.manifest();
server.reset(); server.reset();
await testObject.sync(manifest); await testObject.sync(manifest);
assert.deepEqual(server.requests, [ assert.deepStrictEqual(server.requests, [
{ type: 'GET', url: `${server.url}/v1/resource/${testObject.resource}/latest`, headers: {} }, { type: 'GET', url: `${server.url}/v1/resource/${testObject.resource}/latest`, headers: {} },
]); ]);
assert.ok(!await fileService.exists(keybindingsResource)); assert.ok(!await fileService.exists(keybindingsResource));
const lastSyncUserData = await testObject.getLastSyncUserData(); const lastSyncUserData = await testObject.getLastSyncUserData();
const remoteUserData = await testObject.getRemoteUserData(null); const remoteUserData = await testObject.getRemoteUserData(null);
assert.deepEqual(lastSyncUserData!.ref, remoteUserData.ref); assert.deepStrictEqual(lastSyncUserData!.ref, remoteUserData.ref);
assert.deepEqual(lastSyncUserData!.syncData, remoteUserData.syncData); assert.deepStrictEqual(lastSyncUserData!.syncData, remoteUserData.syncData);
assert.strictEqual(lastSyncUserData!.syncData, null); assert.strictEqual(lastSyncUserData!.syncData, null);
manifest = await client.manifest(); manifest = await client.manifest();
server.reset(); server.reset();
await testObject.sync(manifest); await testObject.sync(manifest);
assert.deepEqual(server.requests, []); assert.deepStrictEqual(server.requests, []);
manifest = await client.manifest(); manifest = await client.manifest();
server.reset(); server.reset();
await testObject.sync(manifest); await testObject.sync(manifest);
assert.deepEqual(server.requests, []); assert.deepStrictEqual(server.requests, []);
}); });
test('when keybindings file is empty and remote has no changes', async () => { test('when keybindings file is empty and remote has no changes', async () => {
@ -175,14 +175,14 @@ suite('KeybindingsSync', () => {
server.reset(); server.reset();
await testObject.sync(manifest); await testObject.sync(manifest);
assert.deepEqual(server.requests, [ assert.deepStrictEqual(server.requests, [
{ type: 'POST', url: `${server.url}/v1/resource/${testObject.resource}`, headers: { 'If-Match': lastSyncUserData?.ref } }, { type: 'POST', url: `${server.url}/v1/resource/${testObject.resource}`, headers: { 'If-Match': lastSyncUserData?.ref } },
]); ]);
lastSyncUserData = await testObject.getLastSyncUserData(); lastSyncUserData = await testObject.getLastSyncUserData();
const remoteUserData = await testObject.getRemoteUserData(null); const remoteUserData = await testObject.getRemoteUserData(null);
assert.deepEqual(lastSyncUserData!.ref, remoteUserData.ref); assert.deepStrictEqual(lastSyncUserData!.ref, remoteUserData.ref);
assert.deepEqual(lastSyncUserData!.syncData, remoteUserData.syncData); assert.deepStrictEqual(lastSyncUserData!.syncData, remoteUserData.syncData);
assert.strictEqual(getKeybindingsContentFromSyncContent(lastSyncUserData!.syncData!.content!, true), '[]'); assert.strictEqual(getKeybindingsContentFromSyncContent(lastSyncUserData!.syncData!.content!, true), '[]');
}); });
@ -199,7 +199,7 @@ suite('KeybindingsSync', () => {
const content = await testObject.resolveContent(preview.resourcePreviews[0].remoteResource); const content = await testObject.resolveContent(preview.resourcePreviews[0].remoteResource);
await testObject.accept(preview.resourcePreviews[0].remoteResource, content); await testObject.accept(preview.resourcePreviews[0].remoteResource, content);
await testObject.apply(false); await testObject.apply(false);
assert.deepEqual(server.requests, []); assert.deepStrictEqual(server.requests, []);
}); });
}); });

View file

@ -400,7 +400,7 @@ suite('SettingsMerge - Merge', () => {
assert.strictEqual(actual.localContent, localContent); assert.strictEqual(actual.localContent, localContent);
assert.strictEqual(actual.remoteContent, remoteContent); assert.strictEqual(actual.remoteContent, remoteContent);
assert.ok(actual.hasConflicts); assert.ok(actual.hasConflicts);
assert.deepEqual(actual.conflictsSettings, expectedConflicts); assert.deepStrictEqual(actual.conflictsSettings, expectedConflicts);
}); });
test('merge when the entry is removed in remote but updated in local and a new entry is added in remote', async () => { test('merge when the entry is removed in remote but updated in local and a new entry is added in remote', async () => {
@ -421,7 +421,7 @@ suite('SettingsMerge - Merge', () => {
})); }));
assert.strictEqual(actual.remoteContent, remoteContent); assert.strictEqual(actual.remoteContent, remoteContent);
assert.ok(actual.hasConflicts); assert.ok(actual.hasConflicts);
assert.deepEqual(actual.conflictsSettings, expectedConflicts); assert.deepStrictEqual(actual.conflictsSettings, expectedConflicts);
}); });
test('merge with single entry and local is empty', async () => { test('merge with single entry and local is empty', async () => {
@ -437,7 +437,7 @@ suite('SettingsMerge - Merge', () => {
assert.strictEqual(actual.localContent, localContent); assert.strictEqual(actual.localContent, localContent);
assert.strictEqual(actual.remoteContent, remoteContent); assert.strictEqual(actual.remoteContent, remoteContent);
assert.ok(actual.hasConflicts); assert.ok(actual.hasConflicts);
assert.deepEqual(actual.conflictsSettings, expectedConflicts); assert.deepStrictEqual(actual.conflictsSettings, expectedConflicts);
}); });
test('merge when local and remote has moved forwareded with conflicts', async () => { test('merge when local and remote has moved forwareded with conflicts', async () => {
@ -482,7 +482,7 @@ suite('SettingsMerge - Merge', () => {
'f': 1, 'f': 1,
})); }));
assert.ok(actual.hasConflicts); assert.ok(actual.hasConflicts);
assert.deepEqual(actual.conflictsSettings, expectedConflicts); assert.deepStrictEqual(actual.conflictsSettings, expectedConflicts);
}); });
test('merge when local and remote has moved forwareded with change in order', async () => { test('merge when local and remote has moved forwareded with change in order', async () => {
@ -518,7 +518,7 @@ suite('SettingsMerge - Merge', () => {
'c': 4, 'c': 4,
})); }));
assert.ok(actual.hasConflicts); assert.ok(actual.hasConflicts);
assert.deepEqual(actual.conflictsSettings, []); assert.deepStrictEqual(actual.conflictsSettings, []);
}); });
test('merge when local and remote has moved forwareded with comment changes', async () => { test('merge when local and remote has moved forwareded with comment changes', async () => {
@ -547,7 +547,7 @@ suite('SettingsMerge - Merge', () => {
assert.strictEqual(actual.localContent, localContent); assert.strictEqual(actual.localContent, localContent);
assert.strictEqual(actual.remoteContent, remoteContent); assert.strictEqual(actual.remoteContent, remoteContent);
assert.ok(actual.hasConflicts); assert.ok(actual.hasConflicts);
assert.deepEqual(actual.conflictsSettings, []); assert.deepStrictEqual(actual.conflictsSettings, []);
}); });
test('resolve when local and remote has moved forwareded with resolved conflicts', async () => { test('resolve when local and remote has moved forwareded with resolved conflicts', async () => {
@ -589,7 +589,7 @@ suite('SettingsMerge - Merge', () => {
'a': 2, 'a': 2,
})); }));
assert.ok(actual.hasConflicts); assert.ok(actual.hasConflicts);
assert.deepEqual(actual.conflictsSettings, expectedConflicts); assert.deepStrictEqual(actual.conflictsSettings, expectedConflicts);
}); });
test('ignored setting is not merged when changed in local and remote', async () => { test('ignored setting is not merged when changed in local and remote', async () => {
@ -720,7 +720,7 @@ suite('SettingsMerge - Merge', () => {
'b': 3, 'b': 3,
'e': 6, 'e': 6,
})); }));
assert.deepEqual(actual.conflictsSettings, expectedConflicts); assert.deepStrictEqual(actual.conflictsSettings, expectedConflicts);
assert.ok(actual.hasConflicts); assert.ok(actual.hasConflicts);
}); });

View file

@ -52,31 +52,31 @@ suite('SettingsSync - Auto', () => {
const fileService = client.instantiationService.get(IFileService); const fileService = client.instantiationService.get(IFileService);
const settingResource = client.instantiationService.get(IEnvironmentService).settingsResource; const settingResource = client.instantiationService.get(IEnvironmentService).settingsResource;
assert.deepEqual(await testObject.getLastSyncUserData(), null); assert.deepStrictEqual(await testObject.getLastSyncUserData(), null);
let manifest = await client.manifest(); let manifest = await client.manifest();
server.reset(); server.reset();
await testObject.sync(manifest); await testObject.sync(manifest);
assert.deepEqual(server.requests, [ assert.deepStrictEqual(server.requests, [
{ type: 'GET', url: `${server.url}/v1/resource/${testObject.resource}/latest`, headers: {} }, { type: 'GET', url: `${server.url}/v1/resource/${testObject.resource}/latest`, headers: {} },
]); ]);
assert.ok(!await fileService.exists(settingResource)); assert.ok(!await fileService.exists(settingResource));
const lastSyncUserData = await testObject.getLastSyncUserData(); const lastSyncUserData = await testObject.getLastSyncUserData();
const remoteUserData = await testObject.getRemoteUserData(null); const remoteUserData = await testObject.getRemoteUserData(null);
assert.deepEqual(lastSyncUserData!.ref, remoteUserData.ref); assert.deepStrictEqual(lastSyncUserData!.ref, remoteUserData.ref);
assert.deepEqual(lastSyncUserData!.syncData, remoteUserData.syncData); assert.deepStrictEqual(lastSyncUserData!.syncData, remoteUserData.syncData);
assert.strictEqual(lastSyncUserData!.syncData, null); assert.strictEqual(lastSyncUserData!.syncData, null);
manifest = await client.manifest(); manifest = await client.manifest();
server.reset(); server.reset();
await testObject.sync(manifest); await testObject.sync(manifest);
assert.deepEqual(server.requests, []); assert.deepStrictEqual(server.requests, []);
manifest = await client.manifest(); manifest = await client.manifest();
server.reset(); server.reset();
await testObject.sync(manifest); await testObject.sync(manifest);
assert.deepEqual(server.requests, []); assert.deepStrictEqual(server.requests, []);
}); });
test('when settings file is empty and remote has no changes', async () => { test('when settings file is empty and remote has no changes', async () => {
@ -146,14 +146,14 @@ suite('SettingsSync - Auto', () => {
server.reset(); server.reset();
await testObject.sync(manifest); await testObject.sync(manifest);
assert.deepEqual(server.requests, [ assert.deepStrictEqual(server.requests, [
{ type: 'POST', url: `${server.url}/v1/resource/${testObject.resource}`, headers: { 'If-Match': lastSyncUserData?.ref } }, { type: 'POST', url: `${server.url}/v1/resource/${testObject.resource}`, headers: { 'If-Match': lastSyncUserData?.ref } },
]); ]);
lastSyncUserData = await testObject.getLastSyncUserData(); lastSyncUserData = await testObject.getLastSyncUserData();
const remoteUserData = await testObject.getRemoteUserData(null); const remoteUserData = await testObject.getRemoteUserData(null);
assert.deepEqual(lastSyncUserData!.ref, remoteUserData.ref); assert.deepStrictEqual(lastSyncUserData!.ref, remoteUserData.ref);
assert.deepEqual(lastSyncUserData!.syncData, remoteUserData.syncData); assert.deepStrictEqual(lastSyncUserData!.syncData, remoteUserData.syncData);
assert.strictEqual(parseSettingsSyncContent(lastSyncUserData!.syncData!.content!)?.settings, '{}'); assert.strictEqual(parseSettingsSyncContent(lastSyncUserData!.syncData!.content!)?.settings, '{}');
}); });
@ -187,7 +187,7 @@ suite('SettingsSync - Auto', () => {
const { content } = await client.read(testObject.resource); const { content } = await client.read(testObject.resource);
assert.ok(content !== null); assert.ok(content !== null);
const actual = parseSettings(content!); const actual = parseSettings(content!);
assert.deepEqual(actual, expected); assert.deepStrictEqual(actual, expected);
}); });
test('do not sync machine settings', async () => { test('do not sync machine settings', async () => {
@ -211,7 +211,7 @@ suite('SettingsSync - Auto', () => {
const { content } = await client.read(testObject.resource); const { content } = await client.read(testObject.resource);
assert.ok(content !== null); assert.ok(content !== null);
const actual = parseSettings(content!); const actual = parseSettings(content!);
assert.deepEqual(actual, `{ assert.deepStrictEqual(actual, `{
// Always // Always
"files.autoSave": "afterDelay", "files.autoSave": "afterDelay",
"files.simpleDialog.enable": true, "files.simpleDialog.enable": true,
@ -242,7 +242,7 @@ suite('SettingsSync - Auto', () => {
const { content } = await client.read(testObject.resource); const { content } = await client.read(testObject.resource);
assert.ok(content !== null); assert.ok(content !== null);
const actual = parseSettings(content!); const actual = parseSettings(content!);
assert.deepEqual(actual, `{ assert.deepStrictEqual(actual, `{
// Always // Always
"files.autoSave": "afterDelay", "files.autoSave": "afterDelay",
"files.simpleDialog.enable": true, "files.simpleDialog.enable": true,
@ -273,7 +273,7 @@ suite('SettingsSync - Auto', () => {
const { content } = await client.read(testObject.resource); const { content } = await client.read(testObject.resource);
assert.ok(content !== null); assert.ok(content !== null);
const actual = parseSettings(content!); const actual = parseSettings(content!);
assert.deepEqual(actual, `{ assert.deepStrictEqual(actual, `{
// Always // Always
"files.autoSave": "afterDelay", "files.autoSave": "afterDelay",
@ -297,7 +297,7 @@ suite('SettingsSync - Auto', () => {
const { content } = await client.read(testObject.resource); const { content } = await client.read(testObject.resource);
assert.ok(content !== null); assert.ok(content !== null);
const actual = parseSettings(content!); const actual = parseSettings(content!);
assert.deepEqual(actual, `{ assert.deepStrictEqual(actual, `{
}`); }`);
}); });
@ -315,7 +315,7 @@ suite('SettingsSync - Auto', () => {
const { content } = await client.read(testObject.resource); const { content } = await client.read(testObject.resource);
assert.ok(content !== null); assert.ok(content !== null);
const actual = parseSettings(content!); const actual = parseSettings(content!);
assert.deepEqual(actual, `{ assert.deepStrictEqual(actual, `{
, ,
}`); }`);
}); });
@ -367,7 +367,7 @@ suite('SettingsSync - Auto', () => {
const { content } = await client.read(testObject.resource); const { content } = await client.read(testObject.resource);
assert.ok(content !== null); assert.ok(content !== null);
const actual = parseSettings(content!); const actual = parseSettings(content!);
assert.deepEqual(actual, `{ assert.deepStrictEqual(actual, `{
// Always // Always
"files.autoSave": "afterDelay", "files.autoSave": "afterDelay",
"files.simpleDialog.enable": true, "files.simpleDialog.enable": true,
@ -415,7 +415,7 @@ suite('SettingsSync - Auto', () => {
const { content } = await client.read(testObject.resource); const { content } = await client.read(testObject.resource);
assert.ok(content !== null); assert.ok(content !== null);
const actual = parseSettings(content!); const actual = parseSettings(content!);
assert.deepEqual(actual, `{ assert.deepStrictEqual(actual, `{
// Always // Always
"files.autoSave": "afterDelay", "files.autoSave": "afterDelay",
"files.simpleDialog.enable": true, "files.simpleDialog.enable": true,
@ -462,7 +462,7 @@ suite('SettingsSync - Auto', () => {
assert.fail('should fail with invalid content error'); assert.fail('should fail with invalid content error');
} catch (e) { } catch (e) {
assert.ok(e instanceof UserDataSyncError); assert.ok(e instanceof UserDataSyncError);
assert.deepEqual((<UserDataSyncError>e).code, UserDataSyncErrorCode.LocalInvalidContent); assert.deepStrictEqual((<UserDataSyncError>e).code, UserDataSyncErrorCode.LocalInvalidContent);
} }
}); });
@ -488,7 +488,7 @@ suite('SettingsSync - Auto', () => {
const fileService = client.instantiationService.get(IFileService); const fileService = client.instantiationService.get(IFileService);
const mergeContent = (await fileService.readFile(testObject.conflicts[0].previewResource)).value.toString(); const mergeContent = (await fileService.readFile(testObject.conflicts[0].previewResource)).value.toString();
assert.deepEqual(JSON.parse(mergeContent), { assert.deepStrictEqual(JSON.parse(mergeContent), {
'b': 1, 'b': 1,
'settingsSync.ignoredSettings': ['a'] 'settingsSync.ignoredSettings': ['a']
}); });
@ -544,7 +544,7 @@ suite('SettingsSync - Manual', () => {
const { content } = await client.read(testObject.resource); const { content } = await client.read(testObject.resource);
assert.ok(content !== null); assert.ok(content !== null);
const actual = parseSettings(content!); const actual = parseSettings(content!);
assert.deepEqual(actual, `{ assert.deepStrictEqual(actual, `{
// Always // Always
"files.autoSave": "afterDelay", "files.autoSave": "afterDelay",
"files.simpleDialog.enable": true, "files.simpleDialog.enable": true,

View file

@ -116,13 +116,13 @@ suite('SnippetsMerge', () => {
const actual = merge(local, remote, null); const actual = merge(local, remote, null);
assert.deepEqual(actual.local.added, {}); assert.deepStrictEqual(actual.local.added, {});
assert.deepEqual(actual.local.updated, {}); assert.deepStrictEqual(actual.local.updated, {});
assert.deepEqual(actual.local.removed, []); assert.deepStrictEqual(actual.local.removed, []);
assert.deepEqual(actual.conflicts, []); assert.deepStrictEqual(actual.conflicts, []);
assert.deepEqual(actual.remote.added, {}); assert.deepStrictEqual(actual.remote.added, {});
assert.deepEqual(actual.remote.updated, {}); assert.deepStrictEqual(actual.remote.updated, {});
assert.deepEqual(actual.remote.removed, []); assert.deepStrictEqual(actual.remote.removed, []);
}); });
test('merge when local and remote are same with multiple entries', async () => { test('merge when local and remote are same with multiple entries', async () => {
@ -131,13 +131,13 @@ suite('SnippetsMerge', () => {
const actual = merge(local, remote, null); const actual = merge(local, remote, null);
assert.deepEqual(actual.local.added, {}); assert.deepStrictEqual(actual.local.added, {});
assert.deepEqual(actual.local.updated, {}); assert.deepStrictEqual(actual.local.updated, {});
assert.deepEqual(actual.local.removed, []); assert.deepStrictEqual(actual.local.removed, []);
assert.deepEqual(actual.conflicts, []); assert.deepStrictEqual(actual.conflicts, []);
assert.deepEqual(actual.remote.added, {}); assert.deepStrictEqual(actual.remote.added, {});
assert.deepEqual(actual.remote.updated, {}); assert.deepStrictEqual(actual.remote.updated, {});
assert.deepEqual(actual.remote.removed, []); assert.deepStrictEqual(actual.remote.removed, []);
}); });
test('merge when local and remote are same with multiple entries in different order', async () => { test('merge when local and remote are same with multiple entries in different order', async () => {
@ -146,13 +146,13 @@ suite('SnippetsMerge', () => {
const actual = merge(local, remote, null); const actual = merge(local, remote, null);
assert.deepEqual(actual.local.added, {}); assert.deepStrictEqual(actual.local.added, {});
assert.deepEqual(actual.local.updated, {}); assert.deepStrictEqual(actual.local.updated, {});
assert.deepEqual(actual.local.removed, []); assert.deepStrictEqual(actual.local.removed, []);
assert.deepEqual(actual.conflicts, []); assert.deepStrictEqual(actual.conflicts, []);
assert.deepEqual(actual.remote.added, {}); assert.deepStrictEqual(actual.remote.added, {});
assert.deepEqual(actual.remote.updated, {}); assert.deepStrictEqual(actual.remote.updated, {});
assert.deepEqual(actual.remote.removed, []); assert.deepStrictEqual(actual.remote.removed, []);
}); });
test('merge when local and remote are same with different base content', async () => { test('merge when local and remote are same with different base content', async () => {
@ -162,13 +162,13 @@ suite('SnippetsMerge', () => {
const actual = merge(local, remote, base); const actual = merge(local, remote, base);
assert.deepEqual(actual.local.added, {}); assert.deepStrictEqual(actual.local.added, {});
assert.deepEqual(actual.local.updated, {}); assert.deepStrictEqual(actual.local.updated, {});
assert.deepEqual(actual.local.removed, []); assert.deepStrictEqual(actual.local.removed, []);
assert.deepEqual(actual.conflicts, []); assert.deepStrictEqual(actual.conflicts, []);
assert.deepEqual(actual.remote.added, {}); assert.deepStrictEqual(actual.remote.added, {});
assert.deepEqual(actual.remote.updated, {}); assert.deepStrictEqual(actual.remote.updated, {});
assert.deepEqual(actual.remote.removed, []); assert.deepStrictEqual(actual.remote.removed, []);
}); });
test('merge when a new entry is added to remote', async () => { test('merge when a new entry is added to remote', async () => {
@ -177,13 +177,13 @@ suite('SnippetsMerge', () => {
const actual = merge(local, remote, null); const actual = merge(local, remote, null);
assert.deepEqual(actual.local.added, { 'typescript.json': tsSnippet1 }); assert.deepStrictEqual(actual.local.added, { 'typescript.json': tsSnippet1 });
assert.deepEqual(actual.local.updated, {}); assert.deepStrictEqual(actual.local.updated, {});
assert.deepEqual(actual.local.removed, []); assert.deepStrictEqual(actual.local.removed, []);
assert.deepEqual(actual.conflicts, []); assert.deepStrictEqual(actual.conflicts, []);
assert.deepEqual(actual.remote.added, {}); assert.deepStrictEqual(actual.remote.added, {});
assert.deepEqual(actual.remote.updated, {}); assert.deepStrictEqual(actual.remote.updated, {});
assert.deepEqual(actual.remote.removed, []); assert.deepStrictEqual(actual.remote.removed, []);
}); });
test('merge when multiple new entries are added to remote', async () => { test('merge when multiple new entries are added to remote', async () => {
@ -192,13 +192,13 @@ suite('SnippetsMerge', () => {
const actual = merge(local, remote, null); const actual = merge(local, remote, null);
assert.deepEqual(actual.local.added, remote); assert.deepStrictEqual(actual.local.added, remote);
assert.deepEqual(actual.local.updated, {}); assert.deepStrictEqual(actual.local.updated, {});
assert.deepEqual(actual.local.removed, []); assert.deepStrictEqual(actual.local.removed, []);
assert.deepEqual(actual.conflicts, []); assert.deepStrictEqual(actual.conflicts, []);
assert.deepEqual(actual.remote.added, {}); assert.deepStrictEqual(actual.remote.added, {});
assert.deepEqual(actual.remote.updated, {}); assert.deepStrictEqual(actual.remote.updated, {});
assert.deepEqual(actual.remote.removed, []); assert.deepStrictEqual(actual.remote.removed, []);
}); });
test('merge when new entry is added to remote from base and local has not changed', async () => { test('merge when new entry is added to remote from base and local has not changed', async () => {
@ -207,13 +207,13 @@ suite('SnippetsMerge', () => {
const actual = merge(local, remote, local); const actual = merge(local, remote, local);
assert.deepEqual(actual.local.added, { 'typescript.json': tsSnippet1 }); assert.deepStrictEqual(actual.local.added, { 'typescript.json': tsSnippet1 });
assert.deepEqual(actual.local.updated, {}); assert.deepStrictEqual(actual.local.updated, {});
assert.deepEqual(actual.local.removed, []); assert.deepStrictEqual(actual.local.removed, []);
assert.deepEqual(actual.conflicts, []); assert.deepStrictEqual(actual.conflicts, []);
assert.deepEqual(actual.remote.added, {}); assert.deepStrictEqual(actual.remote.added, {});
assert.deepEqual(actual.remote.updated, {}); assert.deepStrictEqual(actual.remote.updated, {});
assert.deepEqual(actual.remote.removed, []); assert.deepStrictEqual(actual.remote.removed, []);
}); });
test('merge when an entry is removed from remote from base and local has not changed', async () => { test('merge when an entry is removed from remote from base and local has not changed', async () => {
@ -222,13 +222,13 @@ suite('SnippetsMerge', () => {
const actual = merge(local, remote, local); const actual = merge(local, remote, local);
assert.deepEqual(actual.local.added, {}); assert.deepStrictEqual(actual.local.added, {});
assert.deepEqual(actual.local.updated, {}); assert.deepStrictEqual(actual.local.updated, {});
assert.deepEqual(actual.local.removed, ['typescript.json']); assert.deepStrictEqual(actual.local.removed, ['typescript.json']);
assert.deepEqual(actual.conflicts, []); assert.deepStrictEqual(actual.conflicts, []);
assert.deepEqual(actual.remote.added, {}); assert.deepStrictEqual(actual.remote.added, {});
assert.deepEqual(actual.remote.updated, {}); assert.deepStrictEqual(actual.remote.updated, {});
assert.deepEqual(actual.remote.removed, []); assert.deepStrictEqual(actual.remote.removed, []);
}); });
test('merge when all entries are removed from base and local has not changed', async () => { test('merge when all entries are removed from base and local has not changed', async () => {
@ -237,13 +237,13 @@ suite('SnippetsMerge', () => {
const actual = merge(local, remote, local); const actual = merge(local, remote, local);
assert.deepEqual(actual.local.added, {}); assert.deepStrictEqual(actual.local.added, {});
assert.deepEqual(actual.local.updated, {}); assert.deepStrictEqual(actual.local.updated, {});
assert.deepEqual(actual.local.removed, ['html.json', 'typescript.json']); assert.deepStrictEqual(actual.local.removed, ['html.json', 'typescript.json']);
assert.deepEqual(actual.conflicts, []); assert.deepStrictEqual(actual.conflicts, []);
assert.deepEqual(actual.remote.added, {}); assert.deepStrictEqual(actual.remote.added, {});
assert.deepEqual(actual.remote.updated, {}); assert.deepStrictEqual(actual.remote.updated, {});
assert.deepEqual(actual.remote.removed, []); assert.deepStrictEqual(actual.remote.removed, []);
}); });
test('merge when an entry is updated in remote from base and local has not changed', async () => { test('merge when an entry is updated in remote from base and local has not changed', async () => {
@ -252,13 +252,13 @@ suite('SnippetsMerge', () => {
const actual = merge(local, remote, local); const actual = merge(local, remote, local);
assert.deepEqual(actual.local.added, {}); assert.deepStrictEqual(actual.local.added, {});
assert.deepEqual(actual.local.updated, { 'html.json': htmlSnippet2 }); assert.deepStrictEqual(actual.local.updated, { 'html.json': htmlSnippet2 });
assert.deepEqual(actual.local.removed, []); assert.deepStrictEqual(actual.local.removed, []);
assert.deepEqual(actual.conflicts, []); assert.deepStrictEqual(actual.conflicts, []);
assert.deepEqual(actual.remote.added, {}); assert.deepStrictEqual(actual.remote.added, {});
assert.deepEqual(actual.remote.updated, {}); assert.deepStrictEqual(actual.remote.updated, {});
assert.deepEqual(actual.remote.removed, []); assert.deepStrictEqual(actual.remote.removed, []);
}); });
test('merge when remote has moved forwarded with multiple changes and local stays with base', async () => { test('merge when remote has moved forwarded with multiple changes and local stays with base', async () => {
@ -267,13 +267,13 @@ suite('SnippetsMerge', () => {
const actual = merge(local, remote, local); const actual = merge(local, remote, local);
assert.deepEqual(actual.local.added, { 'c.json': cSnippet }); assert.deepStrictEqual(actual.local.added, { 'c.json': cSnippet });
assert.deepEqual(actual.local.updated, { 'html.json': htmlSnippet2 }); assert.deepStrictEqual(actual.local.updated, { 'html.json': htmlSnippet2 });
assert.deepEqual(actual.local.removed, ['typescript.json']); assert.deepStrictEqual(actual.local.removed, ['typescript.json']);
assert.deepEqual(actual.conflicts, []); assert.deepStrictEqual(actual.conflicts, []);
assert.deepEqual(actual.remote.added, {}); assert.deepStrictEqual(actual.remote.added, {});
assert.deepEqual(actual.remote.updated, {}); assert.deepStrictEqual(actual.remote.updated, {});
assert.deepEqual(actual.remote.removed, []); assert.deepStrictEqual(actual.remote.removed, []);
}); });
test('merge when a new entries are added to local', async () => { test('merge when a new entries are added to local', async () => {
@ -282,13 +282,13 @@ suite('SnippetsMerge', () => {
const actual = merge(local, remote, null); const actual = merge(local, remote, null);
assert.deepEqual(actual.local.added, {}); assert.deepStrictEqual(actual.local.added, {});
assert.deepEqual(actual.local.updated, {}); assert.deepStrictEqual(actual.local.updated, {});
assert.deepEqual(actual.local.removed, []); assert.deepStrictEqual(actual.local.removed, []);
assert.deepEqual(actual.conflicts, []); assert.deepStrictEqual(actual.conflicts, []);
assert.deepEqual(actual.remote.added, { 'c.json': cSnippet }); assert.deepStrictEqual(actual.remote.added, { 'c.json': cSnippet });
assert.deepEqual(actual.remote.updated, {}); assert.deepStrictEqual(actual.remote.updated, {});
assert.deepEqual(actual.remote.removed, []); assert.deepStrictEqual(actual.remote.removed, []);
}); });
test('merge when multiple new entries are added to local from base and remote is not changed', async () => { test('merge when multiple new entries are added to local from base and remote is not changed', async () => {
@ -297,13 +297,13 @@ suite('SnippetsMerge', () => {
const actual = merge(local, remote, remote); const actual = merge(local, remote, remote);
assert.deepEqual(actual.local.added, {}); assert.deepStrictEqual(actual.local.added, {});
assert.deepEqual(actual.local.updated, {}); assert.deepStrictEqual(actual.local.updated, {});
assert.deepEqual(actual.local.removed, []); assert.deepStrictEqual(actual.local.removed, []);
assert.deepEqual(actual.conflicts, []); assert.deepStrictEqual(actual.conflicts, []);
assert.deepEqual(actual.remote.added, { 'html.json': htmlSnippet1, 'c.json': cSnippet }); assert.deepStrictEqual(actual.remote.added, { 'html.json': htmlSnippet1, 'c.json': cSnippet });
assert.deepEqual(actual.remote.updated, {}); assert.deepStrictEqual(actual.remote.updated, {});
assert.deepEqual(actual.remote.removed, []); assert.deepStrictEqual(actual.remote.removed, []);
}); });
test('merge when an entry is removed from local from base and remote has not changed', async () => { test('merge when an entry is removed from local from base and remote has not changed', async () => {
@ -312,13 +312,13 @@ suite('SnippetsMerge', () => {
const actual = merge(local, remote, remote); const actual = merge(local, remote, remote);
assert.deepEqual(actual.local.added, {}); assert.deepStrictEqual(actual.local.added, {});
assert.deepEqual(actual.local.updated, {}); assert.deepStrictEqual(actual.local.updated, {});
assert.deepEqual(actual.local.removed, []); assert.deepStrictEqual(actual.local.removed, []);
assert.deepEqual(actual.conflicts, []); assert.deepStrictEqual(actual.conflicts, []);
assert.deepEqual(actual.remote.added, {}); assert.deepStrictEqual(actual.remote.added, {});
assert.deepEqual(actual.remote.updated, {}); assert.deepStrictEqual(actual.remote.updated, {});
assert.deepEqual(actual.remote.removed, ['typescript.json']); assert.deepStrictEqual(actual.remote.removed, ['typescript.json']);
}); });
test('merge when an entry is updated in local from base and remote has not changed', async () => { test('merge when an entry is updated in local from base and remote has not changed', async () => {
@ -327,13 +327,13 @@ suite('SnippetsMerge', () => {
const actual = merge(local, remote, remote); const actual = merge(local, remote, remote);
assert.deepEqual(actual.local.added, {}); assert.deepStrictEqual(actual.local.added, {});
assert.deepEqual(actual.local.updated, {}); assert.deepStrictEqual(actual.local.updated, {});
assert.deepEqual(actual.local.removed, []); assert.deepStrictEqual(actual.local.removed, []);
assert.deepEqual(actual.conflicts, []); assert.deepStrictEqual(actual.conflicts, []);
assert.deepEqual(actual.remote.added, {}); assert.deepStrictEqual(actual.remote.added, {});
assert.deepEqual(actual.remote.updated, { 'html.json': htmlSnippet2 }); assert.deepStrictEqual(actual.remote.updated, { 'html.json': htmlSnippet2 });
assert.deepEqual(actual.remote.removed, []); assert.deepStrictEqual(actual.remote.removed, []);
}); });
test('merge when local has moved forwarded with multiple changes and remote stays with base', async () => { test('merge when local has moved forwarded with multiple changes and remote stays with base', async () => {
@ -342,13 +342,13 @@ suite('SnippetsMerge', () => {
const actual = merge(local, remote, remote); const actual = merge(local, remote, remote);
assert.deepEqual(actual.local.added, {}); assert.deepStrictEqual(actual.local.added, {});
assert.deepEqual(actual.local.updated, {}); assert.deepStrictEqual(actual.local.updated, {});
assert.deepEqual(actual.local.removed, []); assert.deepStrictEqual(actual.local.removed, []);
assert.deepEqual(actual.conflicts, []); assert.deepStrictEqual(actual.conflicts, []);
assert.deepEqual(actual.remote.added, { 'c.json': cSnippet }); assert.deepStrictEqual(actual.remote.added, { 'c.json': cSnippet });
assert.deepEqual(actual.remote.updated, { 'html.json': htmlSnippet2 }); assert.deepStrictEqual(actual.remote.updated, { 'html.json': htmlSnippet2 });
assert.deepEqual(actual.remote.removed, ['typescript.json']); assert.deepStrictEqual(actual.remote.removed, ['typescript.json']);
}); });
test('merge when local and remote with one entry but different value', async () => { test('merge when local and remote with one entry but different value', async () => {
@ -357,13 +357,13 @@ suite('SnippetsMerge', () => {
const actual = merge(local, remote, null); const actual = merge(local, remote, null);
assert.deepEqual(actual.local.added, {}); assert.deepStrictEqual(actual.local.added, {});
assert.deepEqual(actual.local.updated, {}); assert.deepStrictEqual(actual.local.updated, {});
assert.deepEqual(actual.local.removed, []); assert.deepStrictEqual(actual.local.removed, []);
assert.deepEqual(actual.conflicts, ['html.json']); assert.deepStrictEqual(actual.conflicts, ['html.json']);
assert.deepEqual(actual.remote.added, {}); assert.deepStrictEqual(actual.remote.added, {});
assert.deepEqual(actual.remote.updated, {}); assert.deepStrictEqual(actual.remote.updated, {});
assert.deepEqual(actual.remote.removed, []); assert.deepStrictEqual(actual.remote.removed, []);
}); });
test('merge when the entry is removed in remote but updated in local and a new entry is added in remote', async () => { test('merge when the entry is removed in remote but updated in local and a new entry is added in remote', async () => {
@ -373,13 +373,13 @@ suite('SnippetsMerge', () => {
const actual = merge(local, remote, base); const actual = merge(local, remote, base);
assert.deepEqual(actual.local.added, { 'typescript.json': tsSnippet1 }); assert.deepStrictEqual(actual.local.added, { 'typescript.json': tsSnippet1 });
assert.deepEqual(actual.local.updated, {}); assert.deepStrictEqual(actual.local.updated, {});
assert.deepEqual(actual.local.removed, []); assert.deepStrictEqual(actual.local.removed, []);
assert.deepEqual(actual.conflicts, ['html.json']); assert.deepStrictEqual(actual.conflicts, ['html.json']);
assert.deepEqual(actual.remote.added, {}); assert.deepStrictEqual(actual.remote.added, {});
assert.deepEqual(actual.remote.updated, {}); assert.deepStrictEqual(actual.remote.updated, {});
assert.deepEqual(actual.remote.removed, []); assert.deepStrictEqual(actual.remote.removed, []);
}); });
test('merge with single entry and local is empty', async () => { test('merge with single entry and local is empty', async () => {
@ -389,13 +389,13 @@ suite('SnippetsMerge', () => {
const actual = merge(local, remote, base); const actual = merge(local, remote, base);
assert.deepEqual(actual.local.added, { 'html.json': htmlSnippet2 }); assert.deepStrictEqual(actual.local.added, { 'html.json': htmlSnippet2 });
assert.deepEqual(actual.local.updated, {}); assert.deepStrictEqual(actual.local.updated, {});
assert.deepEqual(actual.local.removed, []); assert.deepStrictEqual(actual.local.removed, []);
assert.deepEqual(actual.conflicts, []); assert.deepStrictEqual(actual.conflicts, []);
assert.deepEqual(actual.remote.added, {}); assert.deepStrictEqual(actual.remote.added, {});
assert.deepEqual(actual.remote.updated, {}); assert.deepStrictEqual(actual.remote.updated, {});
assert.deepEqual(actual.remote.removed, []); assert.deepStrictEqual(actual.remote.removed, []);
}); });
test('merge when local and remote has moved forwareded with conflicts', async () => { test('merge when local and remote has moved forwareded with conflicts', async () => {
@ -405,13 +405,13 @@ suite('SnippetsMerge', () => {
const actual = merge(local, remote, base); const actual = merge(local, remote, base);
assert.deepEqual(actual.local.added, { 'typescript.json': tsSnippet2 }); assert.deepStrictEqual(actual.local.added, { 'typescript.json': tsSnippet2 });
assert.deepEqual(actual.local.updated, {}); assert.deepStrictEqual(actual.local.updated, {});
assert.deepEqual(actual.local.removed, []); assert.deepStrictEqual(actual.local.removed, []);
assert.deepEqual(actual.conflicts, ['html.json']); assert.deepStrictEqual(actual.conflicts, ['html.json']);
assert.deepEqual(actual.remote.added, { 'c.json': cSnippet }); assert.deepStrictEqual(actual.remote.added, { 'c.json': cSnippet });
assert.deepEqual(actual.remote.updated, {}); assert.deepStrictEqual(actual.remote.updated, {});
assert.deepEqual(actual.remote.removed, []); assert.deepStrictEqual(actual.remote.removed, []);
}); });
test('merge when local and remote has moved forwareded with multiple conflicts', async () => { test('merge when local and remote has moved forwareded with multiple conflicts', async () => {
@ -421,13 +421,13 @@ suite('SnippetsMerge', () => {
const actual = merge(local, remote, base); const actual = merge(local, remote, base);
assert.deepEqual(actual.local.added, {}); assert.deepStrictEqual(actual.local.added, {});
assert.deepEqual(actual.local.updated, {}); assert.deepStrictEqual(actual.local.updated, {});
assert.deepEqual(actual.local.removed, []); assert.deepStrictEqual(actual.local.removed, []);
assert.deepEqual(actual.conflicts, ['html.json', 'typescript.json']); assert.deepStrictEqual(actual.conflicts, ['html.json', 'typescript.json']);
assert.deepEqual(actual.remote.added, {}); assert.deepStrictEqual(actual.remote.added, {});
assert.deepEqual(actual.remote.updated, {}); assert.deepStrictEqual(actual.remote.updated, {});
assert.deepEqual(actual.remote.removed, []); assert.deepStrictEqual(actual.remote.removed, []);
}); });
}); });

View file

@ -171,31 +171,31 @@ suite('SnippetsSync', () => {
const fileService = testClient.instantiationService.get(IFileService); const fileService = testClient.instantiationService.get(IFileService);
const snippetsResource = testClient.instantiationService.get(IEnvironmentService).snippetsHome; const snippetsResource = testClient.instantiationService.get(IEnvironmentService).snippetsHome;
assert.deepEqual(await testObject.getLastSyncUserData(), null); assert.deepStrictEqual(await testObject.getLastSyncUserData(), null);
let manifest = await testClient.manifest(); let manifest = await testClient.manifest();
server.reset(); server.reset();
await testObject.sync(manifest); await testObject.sync(manifest);
assert.deepEqual(server.requests, [ assert.deepStrictEqual(server.requests, [
{ type: 'GET', url: `${server.url}/v1/resource/${testObject.resource}/latest`, headers: {} }, { type: 'GET', url: `${server.url}/v1/resource/${testObject.resource}/latest`, headers: {} },
]); ]);
assert.ok(!await fileService.exists(snippetsResource)); assert.ok(!await fileService.exists(snippetsResource));
const lastSyncUserData = await testObject.getLastSyncUserData(); const lastSyncUserData = await testObject.getLastSyncUserData();
const remoteUserData = await testObject.getRemoteUserData(null); const remoteUserData = await testObject.getRemoteUserData(null);
assert.deepEqual(lastSyncUserData!.ref, remoteUserData.ref); assert.deepStrictEqual(lastSyncUserData!.ref, remoteUserData.ref);
assert.deepEqual(lastSyncUserData!.syncData, remoteUserData.syncData); assert.deepStrictEqual(lastSyncUserData!.syncData, remoteUserData.syncData);
assert.strictEqual(lastSyncUserData!.syncData, null); assert.strictEqual(lastSyncUserData!.syncData, null);
manifest = await testClient.manifest(); manifest = await testClient.manifest();
server.reset(); server.reset();
await testObject.sync(manifest); await testObject.sync(manifest);
assert.deepEqual(server.requests, []); assert.deepStrictEqual(server.requests, []);
manifest = await testClient.manifest(); manifest = await testClient.manifest();
server.reset(); server.reset();
await testObject.sync(manifest); await testObject.sync(manifest);
assert.deepEqual(server.requests, []); assert.deepStrictEqual(server.requests, []);
}); });
test('when snippet is created after first sync', async () => { test('when snippet is created after first sync', async () => {
@ -207,15 +207,15 @@ suite('SnippetsSync', () => {
server.reset(); server.reset();
await testObject.sync(manifest); await testObject.sync(manifest);
assert.deepEqual(server.requests, [ assert.deepStrictEqual(server.requests, [
{ type: 'POST', url: `${server.url}/v1/resource/${testObject.resource}`, headers: { 'If-Match': lastSyncUserData?.ref } }, { type: 'POST', url: `${server.url}/v1/resource/${testObject.resource}`, headers: { 'If-Match': lastSyncUserData?.ref } },
]); ]);
lastSyncUserData = await testObject.getLastSyncUserData(); lastSyncUserData = await testObject.getLastSyncUserData();
const remoteUserData = await testObject.getRemoteUserData(null); const remoteUserData = await testObject.getRemoteUserData(null);
assert.deepEqual(lastSyncUserData!.ref, remoteUserData.ref); assert.deepStrictEqual(lastSyncUserData!.ref, remoteUserData.ref);
assert.deepEqual(lastSyncUserData!.syncData, remoteUserData.syncData); assert.deepStrictEqual(lastSyncUserData!.syncData, remoteUserData.syncData);
assert.deepEqual(lastSyncUserData!.syncData!.content, JSON.stringify({ 'html.json': htmlSnippet1 })); assert.deepStrictEqual(lastSyncUserData!.syncData!.content, JSON.stringify({ 'html.json': htmlSnippet1 }));
}); });
test('first time sync - outgoing to server (no snippets)', async () => { test('first time sync - outgoing to server (no snippets)', async () => {
@ -224,12 +224,12 @@ suite('SnippetsSync', () => {
await testObject.sync(await testClient.manifest()); await testObject.sync(await testClient.manifest());
assert.strictEqual(testObject.status, SyncStatus.Idle); assert.strictEqual(testObject.status, SyncStatus.Idle);
assert.deepEqual(testObject.conflicts, []); assert.deepStrictEqual(testObject.conflicts, []);
const { content } = await testClient.read(testObject.resource); const { content } = await testClient.read(testObject.resource);
assert.ok(content !== null); assert.ok(content !== null);
const actual = parseSnippets(content!); const actual = parseSnippets(content!);
assert.deepEqual(actual, { 'html.json': htmlSnippet1, 'typescript.json': tsSnippet1 }); assert.deepStrictEqual(actual, { 'html.json': htmlSnippet1, 'typescript.json': tsSnippet1 });
}); });
test('first time sync - incoming from server (no snippets)', async () => { test('first time sync - incoming from server (no snippets)', async () => {
@ -239,7 +239,7 @@ suite('SnippetsSync', () => {
await testObject.sync(await testClient.manifest()); await testObject.sync(await testClient.manifest());
assert.strictEqual(testObject.status, SyncStatus.Idle); assert.strictEqual(testObject.status, SyncStatus.Idle);
assert.deepEqual(testObject.conflicts, []); assert.deepStrictEqual(testObject.conflicts, []);
const actual1 = await readSnippet('html.json', testClient); const actual1 = await readSnippet('html.json', testClient);
assert.strictEqual(actual1, htmlSnippet1); assert.strictEqual(actual1, htmlSnippet1);
@ -254,7 +254,7 @@ suite('SnippetsSync', () => {
await updateSnippet('typescript.json', tsSnippet1, testClient); await updateSnippet('typescript.json', tsSnippet1, testClient);
await testObject.sync(await testClient.manifest()); await testObject.sync(await testClient.manifest());
assert.strictEqual(testObject.status, SyncStatus.Idle); assert.strictEqual(testObject.status, SyncStatus.Idle);
assert.deepEqual(testObject.conflicts, []); assert.deepStrictEqual(testObject.conflicts, []);
const actual1 = await readSnippet('html.json', testClient); const actual1 = await readSnippet('html.json', testClient);
assert.strictEqual(actual1, htmlSnippet1); assert.strictEqual(actual1, htmlSnippet1);
@ -264,7 +264,7 @@ suite('SnippetsSync', () => {
const { content } = await testClient.read(testObject.resource); const { content } = await testClient.read(testObject.resource);
assert.ok(content !== null); assert.ok(content !== null);
const actual = parseSnippets(content!); const actual = parseSnippets(content!);
assert.deepEqual(actual, { 'html.json': htmlSnippet1, 'typescript.json': tsSnippet1 }); assert.deepStrictEqual(actual, { 'html.json': htmlSnippet1, 'typescript.json': tsSnippet1 });
}); });
test('first time sync when snippets exists - has conflicts', async () => { test('first time sync when snippets exists - has conflicts', async () => {
@ -291,7 +291,7 @@ suite('SnippetsSync', () => {
await testObject.apply(false); await testObject.apply(false);
assert.strictEqual(testObject.status, SyncStatus.Idle); assert.strictEqual(testObject.status, SyncStatus.Idle);
assert.deepEqual(testObject.conflicts, []); assert.deepStrictEqual(testObject.conflicts, []);
const actual1 = await readSnippet('html.json', testClient); const actual1 = await readSnippet('html.json', testClient);
assert.strictEqual(actual1, htmlSnippet1); assert.strictEqual(actual1, htmlSnippet1);
@ -299,7 +299,7 @@ suite('SnippetsSync', () => {
const { content } = await testClient.read(testObject.resource); const { content } = await testClient.read(testObject.resource);
assert.ok(content !== null); assert.ok(content !== null);
const actual = parseSnippets(content!); const actual = parseSnippets(content!);
assert.deepEqual(actual, { 'html.json': htmlSnippet1 }); assert.deepStrictEqual(actual, { 'html.json': htmlSnippet1 });
}); });
test('first time sync when snippets exists - has multiple conflicts', async () => { test('first time sync when snippets exists - has multiple conflicts', async () => {
@ -352,7 +352,7 @@ suite('SnippetsSync', () => {
await testObject.apply(false); await testObject.apply(false);
assert.strictEqual(testObject.status, SyncStatus.Idle); assert.strictEqual(testObject.status, SyncStatus.Idle);
assert.deepEqual(testObject.conflicts, []); assert.deepStrictEqual(testObject.conflicts, []);
const actual1 = await readSnippet('html.json', testClient); const actual1 = await readSnippet('html.json', testClient);
assert.strictEqual(actual1, htmlSnippet2); assert.strictEqual(actual1, htmlSnippet2);
@ -362,7 +362,7 @@ suite('SnippetsSync', () => {
const { content } = await testClient.read(testObject.resource); const { content } = await testClient.read(testObject.resource);
assert.ok(content !== null); assert.ok(content !== null);
const actual = parseSnippets(content!); const actual = parseSnippets(content!);
assert.deepEqual(actual, { 'html.json': htmlSnippet2, 'typescript.json': tsSnippet1 }); assert.deepStrictEqual(actual, { 'html.json': htmlSnippet2, 'typescript.json': tsSnippet1 });
}); });
test('sync adding a snippet', async () => { test('sync adding a snippet', async () => {
@ -372,7 +372,7 @@ suite('SnippetsSync', () => {
await updateSnippet('typescript.json', tsSnippet1, testClient); await updateSnippet('typescript.json', tsSnippet1, testClient);
await testObject.sync(await testClient.manifest()); await testObject.sync(await testClient.manifest());
assert.strictEqual(testObject.status, SyncStatus.Idle); assert.strictEqual(testObject.status, SyncStatus.Idle);
assert.deepEqual(testObject.conflicts, []); assert.deepStrictEqual(testObject.conflicts, []);
const actual1 = await readSnippet('html.json', testClient); const actual1 = await readSnippet('html.json', testClient);
assert.strictEqual(actual1, htmlSnippet1); assert.strictEqual(actual1, htmlSnippet1);
@ -382,7 +382,7 @@ suite('SnippetsSync', () => {
const { content } = await testClient.read(testObject.resource); const { content } = await testClient.read(testObject.resource);
assert.ok(content !== null); assert.ok(content !== null);
const actual = parseSnippets(content!); const actual = parseSnippets(content!);
assert.deepEqual(actual, { 'html.json': htmlSnippet1, 'typescript.json': tsSnippet1 }); assert.deepStrictEqual(actual, { 'html.json': htmlSnippet1, 'typescript.json': tsSnippet1 });
}); });
test('sync adding a snippet - accept', async () => { test('sync adding a snippet - accept', async () => {
@ -395,7 +395,7 @@ suite('SnippetsSync', () => {
await testObject.sync(await testClient.manifest()); await testObject.sync(await testClient.manifest());
assert.strictEqual(testObject.status, SyncStatus.Idle); assert.strictEqual(testObject.status, SyncStatus.Idle);
assert.deepEqual(testObject.conflicts, []); assert.deepStrictEqual(testObject.conflicts, []);
const actual1 = await readSnippet('html.json', testClient); const actual1 = await readSnippet('html.json', testClient);
assert.strictEqual(actual1, htmlSnippet1); assert.strictEqual(actual1, htmlSnippet1);
@ -410,7 +410,7 @@ suite('SnippetsSync', () => {
await updateSnippet('html.json', htmlSnippet2, testClient); await updateSnippet('html.json', htmlSnippet2, testClient);
await testObject.sync(await testClient.manifest()); await testObject.sync(await testClient.manifest());
assert.strictEqual(testObject.status, SyncStatus.Idle); assert.strictEqual(testObject.status, SyncStatus.Idle);
assert.deepEqual(testObject.conflicts, []); assert.deepStrictEqual(testObject.conflicts, []);
const actual1 = await readSnippet('html.json', testClient); const actual1 = await readSnippet('html.json', testClient);
assert.strictEqual(actual1, htmlSnippet2); assert.strictEqual(actual1, htmlSnippet2);
@ -418,7 +418,7 @@ suite('SnippetsSync', () => {
const { content } = await testClient.read(testObject.resource); const { content } = await testClient.read(testObject.resource);
assert.ok(content !== null); assert.ok(content !== null);
const actual = parseSnippets(content!); const actual = parseSnippets(content!);
assert.deepEqual(actual, { 'html.json': htmlSnippet2 }); assert.deepStrictEqual(actual, { 'html.json': htmlSnippet2 });
}); });
test('sync updating a snippet - accept', async () => { test('sync updating a snippet - accept', async () => {
@ -431,7 +431,7 @@ suite('SnippetsSync', () => {
await testObject.sync(await testClient.manifest()); await testObject.sync(await testClient.manifest());
assert.strictEqual(testObject.status, SyncStatus.Idle); assert.strictEqual(testObject.status, SyncStatus.Idle);
assert.deepEqual(testObject.conflicts, []); assert.deepStrictEqual(testObject.conflicts, []);
const actual1 = await readSnippet('html.json', testClient); const actual1 = await readSnippet('html.json', testClient);
assert.strictEqual(actual1, htmlSnippet2); assert.strictEqual(actual1, htmlSnippet2);
@ -467,7 +467,7 @@ suite('SnippetsSync', () => {
await testObject.apply(false); await testObject.apply(false);
assert.strictEqual(testObject.status, SyncStatus.Idle); assert.strictEqual(testObject.status, SyncStatus.Idle);
assert.deepEqual(testObject.conflicts, []); assert.deepStrictEqual(testObject.conflicts, []);
const actual1 = await readSnippet('html.json', testClient); const actual1 = await readSnippet('html.json', testClient);
assert.strictEqual(actual1, htmlSnippet2); assert.strictEqual(actual1, htmlSnippet2);
@ -475,7 +475,7 @@ suite('SnippetsSync', () => {
const { content } = await testClient.read(testObject.resource); const { content } = await testClient.read(testObject.resource);
assert.ok(content !== null); assert.ok(content !== null);
const actual = parseSnippets(content!); const actual = parseSnippets(content!);
assert.deepEqual(actual, { 'html.json': htmlSnippet2 }); assert.deepStrictEqual(actual, { 'html.json': htmlSnippet2 });
}); });
test('sync removing a snippet', async () => { test('sync removing a snippet', async () => {
@ -486,7 +486,7 @@ suite('SnippetsSync', () => {
await removeSnippet('html.json', testClient); await removeSnippet('html.json', testClient);
await testObject.sync(await testClient.manifest()); await testObject.sync(await testClient.manifest());
assert.strictEqual(testObject.status, SyncStatus.Idle); assert.strictEqual(testObject.status, SyncStatus.Idle);
assert.deepEqual(testObject.conflicts, []); assert.deepStrictEqual(testObject.conflicts, []);
const actual1 = await readSnippet('typescript.json', testClient); const actual1 = await readSnippet('typescript.json', testClient);
assert.strictEqual(actual1, tsSnippet1); assert.strictEqual(actual1, tsSnippet1);
@ -496,7 +496,7 @@ suite('SnippetsSync', () => {
const { content } = await testClient.read(testObject.resource); const { content } = await testClient.read(testObject.resource);
assert.ok(content !== null); assert.ok(content !== null);
const actual = parseSnippets(content!); const actual = parseSnippets(content!);
assert.deepEqual(actual, { 'typescript.json': tsSnippet1 }); assert.deepStrictEqual(actual, { 'typescript.json': tsSnippet1 });
}); });
test('sync removing a snippet - accept', async () => { test('sync removing a snippet - accept', async () => {
@ -510,7 +510,7 @@ suite('SnippetsSync', () => {
await testObject.sync(await testClient.manifest()); await testObject.sync(await testClient.manifest());
assert.strictEqual(testObject.status, SyncStatus.Idle); assert.strictEqual(testObject.status, SyncStatus.Idle);
assert.deepEqual(testObject.conflicts, []); assert.deepStrictEqual(testObject.conflicts, []);
const actual1 = await readSnippet('typescript.json', testClient); const actual1 = await readSnippet('typescript.json', testClient);
assert.strictEqual(actual1, tsSnippet1); assert.strictEqual(actual1, tsSnippet1);
@ -531,7 +531,7 @@ suite('SnippetsSync', () => {
await testObject.sync(await testClient.manifest()); await testObject.sync(await testClient.manifest());
assert.strictEqual(testObject.status, SyncStatus.Idle); assert.strictEqual(testObject.status, SyncStatus.Idle);
assert.deepEqual(testObject.conflicts, []); assert.deepStrictEqual(testObject.conflicts, []);
const actual1 = await readSnippet('typescript.json', testClient); const actual1 = await readSnippet('typescript.json', testClient);
assert.strictEqual(actual1, tsSnippet1); assert.strictEqual(actual1, tsSnippet1);
@ -572,7 +572,7 @@ suite('SnippetsSync', () => {
await testObject.apply(false); await testObject.apply(false);
assert.strictEqual(testObject.status, SyncStatus.Idle); assert.strictEqual(testObject.status, SyncStatus.Idle);
assert.deepEqual(testObject.conflicts, []); assert.deepStrictEqual(testObject.conflicts, []);
const actual1 = await readSnippet('typescript.json', testClient); const actual1 = await readSnippet('typescript.json', testClient);
assert.strictEqual(actual1, tsSnippet1); assert.strictEqual(actual1, tsSnippet1);
@ -582,7 +582,7 @@ suite('SnippetsSync', () => {
const { content } = await testClient.read(testObject.resource); const { content } = await testClient.read(testObject.resource);
assert.ok(content !== null); assert.ok(content !== null);
const actual = parseSnippets(content!); const actual = parseSnippets(content!);
assert.deepEqual(actual, { 'typescript.json': tsSnippet1, 'html.json': htmlSnippet3 }); assert.deepStrictEqual(actual, { 'typescript.json': tsSnippet1, 'html.json': htmlSnippet3 });
}); });
test('sync removing a snippet - resolve conflict by removing', async () => { test('sync removing a snippet - resolve conflict by removing', async () => {
@ -600,7 +600,7 @@ suite('SnippetsSync', () => {
await testObject.apply(false); await testObject.apply(false);
assert.strictEqual(testObject.status, SyncStatus.Idle); assert.strictEqual(testObject.status, SyncStatus.Idle);
assert.deepEqual(testObject.conflicts, []); assert.deepStrictEqual(testObject.conflicts, []);
const actual1 = await readSnippet('typescript.json', testClient); const actual1 = await readSnippet('typescript.json', testClient);
assert.strictEqual(actual1, tsSnippet1); assert.strictEqual(actual1, tsSnippet1);
@ -610,7 +610,7 @@ suite('SnippetsSync', () => {
const { content } = await testClient.read(testObject.resource); const { content } = await testClient.read(testObject.resource);
assert.ok(content !== null); assert.ok(content !== null);
const actual = parseSnippets(content!); const actual = parseSnippets(content!);
assert.deepEqual(actual, { 'typescript.json': tsSnippet1 }); assert.deepStrictEqual(actual, { 'typescript.json': tsSnippet1 });
}); });
test('sync global and language snippet', async () => { test('sync global and language snippet', async () => {
@ -620,7 +620,7 @@ suite('SnippetsSync', () => {
await testObject.sync(await testClient.manifest()); await testObject.sync(await testClient.manifest());
assert.strictEqual(testObject.status, SyncStatus.Idle); assert.strictEqual(testObject.status, SyncStatus.Idle);
assert.deepEqual(testObject.conflicts, []); assert.deepStrictEqual(testObject.conflicts, []);
const actual1 = await readSnippet('html.json', testClient); const actual1 = await readSnippet('html.json', testClient);
assert.strictEqual(actual1, htmlSnippet1); assert.strictEqual(actual1, htmlSnippet1);
@ -630,7 +630,7 @@ suite('SnippetsSync', () => {
const { content } = await testClient.read(testObject.resource); const { content } = await testClient.read(testObject.resource);
assert.ok(content !== null); assert.ok(content !== null);
const actual = parseSnippets(content!); const actual = parseSnippets(content!);
assert.deepEqual(actual, { 'html.json': htmlSnippet1, 'global.code-snippets': globalSnippet }); assert.deepStrictEqual(actual, { 'html.json': htmlSnippet1, 'global.code-snippets': globalSnippet });
}); });
test('sync should ignore non snippets', async () => { test('sync should ignore non snippets', async () => {
@ -641,7 +641,7 @@ suite('SnippetsSync', () => {
await testObject.sync(await testClient.manifest()); await testObject.sync(await testClient.manifest());
assert.strictEqual(testObject.status, SyncStatus.Idle); assert.strictEqual(testObject.status, SyncStatus.Idle);
assert.deepEqual(testObject.conflicts, []); assert.deepStrictEqual(testObject.conflicts, []);
const actual1 = await readSnippet('typescript.json', testClient); const actual1 = await readSnippet('typescript.json', testClient);
assert.strictEqual(actual1, tsSnippet1); assert.strictEqual(actual1, tsSnippet1);
@ -653,7 +653,7 @@ suite('SnippetsSync', () => {
const { content } = await testClient.read(testObject.resource); const { content } = await testClient.read(testObject.resource);
assert.ok(content !== null); assert.ok(content !== null);
const actual = parseSnippets(content!); const actual = parseSnippets(content!);
assert.deepEqual(actual, { 'typescript.json': tsSnippet1, 'global.code-snippets': globalSnippet }); assert.deepStrictEqual(actual, { 'typescript.json': tsSnippet1, 'global.code-snippets': globalSnippet });
}); });
test('previews are reset after all conflicts resolved', async () => { test('previews are reset after all conflicts resolved', async () => {
@ -685,7 +685,7 @@ suite('SnippetsSync', () => {
joinPath(environmentService.userDataSyncHome, testObject.resource, PREVIEW_DIR_NAME, 'html.json'), joinPath(environmentService.userDataSyncHome, testObject.resource, PREVIEW_DIR_NAME, 'html.json'),
joinPath(environmentService.userDataSyncHome, testObject.resource, PREVIEW_DIR_NAME, 'typescript.json'), joinPath(environmentService.userDataSyncHome, testObject.resource, PREVIEW_DIR_NAME, 'typescript.json'),
]); ]);
assert.deepEqual(testObject.conflicts, []); assert.deepStrictEqual(testObject.conflicts, []);
preview = await testObject.merge(preview!.resourcePreviews[0].localResource); preview = await testObject.merge(preview!.resourcePreviews[0].localResource);
@ -695,7 +695,7 @@ suite('SnippetsSync', () => {
joinPath(environmentService.userDataSyncHome, testObject.resource, PREVIEW_DIR_NAME, 'html.json'), joinPath(environmentService.userDataSyncHome, testObject.resource, PREVIEW_DIR_NAME, 'html.json'),
joinPath(environmentService.userDataSyncHome, testObject.resource, PREVIEW_DIR_NAME, 'typescript.json'), joinPath(environmentService.userDataSyncHome, testObject.resource, PREVIEW_DIR_NAME, 'typescript.json'),
]); ]);
assert.deepEqual(testObject.conflicts, []); assert.deepStrictEqual(testObject.conflicts, []);
}); });
test('merge when there are multiple snippets and all snippets are merged', async () => { test('merge when there are multiple snippets and all snippets are merged', async () => {
@ -711,7 +711,7 @@ suite('SnippetsSync', () => {
joinPath(environmentService.userDataSyncHome, testObject.resource, PREVIEW_DIR_NAME, 'html.json'), joinPath(environmentService.userDataSyncHome, testObject.resource, PREVIEW_DIR_NAME, 'html.json'),
joinPath(environmentService.userDataSyncHome, testObject.resource, PREVIEW_DIR_NAME, 'typescript.json'), joinPath(environmentService.userDataSyncHome, testObject.resource, PREVIEW_DIR_NAME, 'typescript.json'),
]); ]);
assert.deepEqual(testObject.conflicts, []); assert.deepStrictEqual(testObject.conflicts, []);
preview = await testObject.merge(preview!.resourcePreviews[0].localResource); preview = await testObject.merge(preview!.resourcePreviews[0].localResource);
preview = await testObject.merge(preview!.resourcePreviews[1].localResource); preview = await testObject.merge(preview!.resourcePreviews[1].localResource);
@ -722,7 +722,7 @@ suite('SnippetsSync', () => {
joinPath(environmentService.userDataSyncHome, testObject.resource, PREVIEW_DIR_NAME, 'html.json'), joinPath(environmentService.userDataSyncHome, testObject.resource, PREVIEW_DIR_NAME, 'html.json'),
joinPath(environmentService.userDataSyncHome, testObject.resource, PREVIEW_DIR_NAME, 'typescript.json'), joinPath(environmentService.userDataSyncHome, testObject.resource, PREVIEW_DIR_NAME, 'typescript.json'),
]); ]);
assert.deepEqual(testObject.conflicts, []); assert.deepStrictEqual(testObject.conflicts, []);
}); });
test('merge when there are multiple snippets and all snippets are merged and applied', async () => { test('merge when there are multiple snippets and all snippets are merged and applied', async () => {
@ -738,7 +738,7 @@ suite('SnippetsSync', () => {
joinPath(environmentService.userDataSyncHome, testObject.resource, PREVIEW_DIR_NAME, 'html.json'), joinPath(environmentService.userDataSyncHome, testObject.resource, PREVIEW_DIR_NAME, 'html.json'),
joinPath(environmentService.userDataSyncHome, testObject.resource, PREVIEW_DIR_NAME, 'typescript.json'), joinPath(environmentService.userDataSyncHome, testObject.resource, PREVIEW_DIR_NAME, 'typescript.json'),
]); ]);
assert.deepEqual(testObject.conflicts, []); assert.deepStrictEqual(testObject.conflicts, []);
preview = await testObject.merge(preview!.resourcePreviews[0].localResource); preview = await testObject.merge(preview!.resourcePreviews[0].localResource);
preview = await testObject.merge(preview!.resourcePreviews[1].localResource); preview = await testObject.merge(preview!.resourcePreviews[1].localResource);
@ -746,7 +746,7 @@ suite('SnippetsSync', () => {
assert.strictEqual(testObject.status, SyncStatus.Idle); assert.strictEqual(testObject.status, SyncStatus.Idle);
assert.strictEqual(preview, null); assert.strictEqual(preview, null);
assert.deepEqual(testObject.conflicts, []); assert.deepStrictEqual(testObject.conflicts, []);
}); });
test('merge when there are multiple snippets and one snippet has no changes and one snippet is merged', async () => { test('merge when there are multiple snippets and one snippet has no changes and one snippet is merged', async () => {
@ -765,7 +765,7 @@ suite('SnippetsSync', () => {
joinPath(environmentService.userDataSyncHome, testObject.resource, PREVIEW_DIR_NAME, 'typescript.json'), joinPath(environmentService.userDataSyncHome, testObject.resource, PREVIEW_DIR_NAME, 'typescript.json'),
joinPath(environmentService.userDataSyncHome, testObject.resource, PREVIEW_DIR_NAME, 'html.json'), joinPath(environmentService.userDataSyncHome, testObject.resource, PREVIEW_DIR_NAME, 'html.json'),
]); ]);
assert.deepEqual(testObject.conflicts, []); assert.deepStrictEqual(testObject.conflicts, []);
preview = await testObject.merge(preview!.resourcePreviews[0].localResource); preview = await testObject.merge(preview!.resourcePreviews[0].localResource);
@ -775,7 +775,7 @@ suite('SnippetsSync', () => {
joinPath(environmentService.userDataSyncHome, testObject.resource, PREVIEW_DIR_NAME, 'typescript.json'), joinPath(environmentService.userDataSyncHome, testObject.resource, PREVIEW_DIR_NAME, 'typescript.json'),
joinPath(environmentService.userDataSyncHome, testObject.resource, PREVIEW_DIR_NAME, 'html.json'), joinPath(environmentService.userDataSyncHome, testObject.resource, PREVIEW_DIR_NAME, 'html.json'),
]); ]);
assert.deepEqual(testObject.conflicts, []); assert.deepStrictEqual(testObject.conflicts, []);
}); });
test('merge when there are multiple snippets and one snippet has no changes and one snippet is merged and applied', async () => { test('merge when there are multiple snippets and one snippet has no changes and one snippet is merged and applied', async () => {
@ -794,14 +794,14 @@ suite('SnippetsSync', () => {
joinPath(environmentService.userDataSyncHome, testObject.resource, PREVIEW_DIR_NAME, 'typescript.json'), joinPath(environmentService.userDataSyncHome, testObject.resource, PREVIEW_DIR_NAME, 'typescript.json'),
joinPath(environmentService.userDataSyncHome, testObject.resource, PREVIEW_DIR_NAME, 'html.json'), joinPath(environmentService.userDataSyncHome, testObject.resource, PREVIEW_DIR_NAME, 'html.json'),
]); ]);
assert.deepEqual(testObject.conflicts, []); assert.deepStrictEqual(testObject.conflicts, []);
preview = await testObject.merge(preview!.resourcePreviews[0].localResource); preview = await testObject.merge(preview!.resourcePreviews[0].localResource);
preview = await testObject.apply(false); preview = await testObject.apply(false);
assert.strictEqual(testObject.status, SyncStatus.Idle); assert.strictEqual(testObject.status, SyncStatus.Idle);
assert.strictEqual(preview, null); assert.strictEqual(preview, null);
assert.deepEqual(testObject.conflicts, []); assert.deepStrictEqual(testObject.conflicts, []);
}); });
test('merge when there are multiple snippets with conflicts and only one snippet is merged', async () => { test('merge when there are multiple snippets with conflicts and only one snippet is merged', async () => {
@ -821,7 +821,7 @@ suite('SnippetsSync', () => {
joinPath(environmentService.userDataSyncHome, testObject.resource, PREVIEW_DIR_NAME, 'html.json'), joinPath(environmentService.userDataSyncHome, testObject.resource, PREVIEW_DIR_NAME, 'html.json'),
joinPath(environmentService.userDataSyncHome, testObject.resource, PREVIEW_DIR_NAME, 'typescript.json'), joinPath(environmentService.userDataSyncHome, testObject.resource, PREVIEW_DIR_NAME, 'typescript.json'),
]); ]);
assert.deepEqual(testObject.conflicts, []); assert.deepStrictEqual(testObject.conflicts, []);
preview = await testObject.merge(preview!.resourcePreviews[0].previewResource); preview = await testObject.merge(preview!.resourcePreviews[0].previewResource);
@ -854,7 +854,7 @@ suite('SnippetsSync', () => {
joinPath(environmentService.userDataSyncHome, testObject.resource, PREVIEW_DIR_NAME, 'html.json'), joinPath(environmentService.userDataSyncHome, testObject.resource, PREVIEW_DIR_NAME, 'html.json'),
joinPath(environmentService.userDataSyncHome, testObject.resource, PREVIEW_DIR_NAME, 'typescript.json'), joinPath(environmentService.userDataSyncHome, testObject.resource, PREVIEW_DIR_NAME, 'typescript.json'),
]); ]);
assert.deepEqual(testObject.conflicts, []); assert.deepStrictEqual(testObject.conflicts, []);
preview = await testObject.merge(preview!.resourcePreviews[0].previewResource); preview = await testObject.merge(preview!.resourcePreviews[0].previewResource);
preview = await testObject.merge(preview!.resourcePreviews[1].previewResource); preview = await testObject.merge(preview!.resourcePreviews[1].previewResource);
@ -889,7 +889,7 @@ suite('SnippetsSync', () => {
joinPath(environmentService.userDataSyncHome, testObject.resource, PREVIEW_DIR_NAME, 'html.json'), joinPath(environmentService.userDataSyncHome, testObject.resource, PREVIEW_DIR_NAME, 'html.json'),
joinPath(environmentService.userDataSyncHome, testObject.resource, PREVIEW_DIR_NAME, 'typescript.json'), joinPath(environmentService.userDataSyncHome, testObject.resource, PREVIEW_DIR_NAME, 'typescript.json'),
]); ]);
assert.deepEqual(testObject.conflicts, []); assert.deepStrictEqual(testObject.conflicts, []);
preview = await testObject.accept(preview!.resourcePreviews[0].previewResource, htmlSnippet2); preview = await testObject.accept(preview!.resourcePreviews[0].previewResource, htmlSnippet2);
@ -899,7 +899,7 @@ suite('SnippetsSync', () => {
joinPath(environmentService.userDataSyncHome, testObject.resource, PREVIEW_DIR_NAME, 'html.json'), joinPath(environmentService.userDataSyncHome, testObject.resource, PREVIEW_DIR_NAME, 'html.json'),
joinPath(environmentService.userDataSyncHome, testObject.resource, PREVIEW_DIR_NAME, 'typescript.json'), joinPath(environmentService.userDataSyncHome, testObject.resource, PREVIEW_DIR_NAME, 'typescript.json'),
]); ]);
assert.deepEqual(testObject.conflicts, []); assert.deepStrictEqual(testObject.conflicts, []);
}); });
test('accept when there are multiple snippets with conflicts and all snippets are accepted', async () => { test('accept when there are multiple snippets with conflicts and all snippets are accepted', async () => {
@ -919,7 +919,7 @@ suite('SnippetsSync', () => {
joinPath(environmentService.userDataSyncHome, testObject.resource, PREVIEW_DIR_NAME, 'html.json'), joinPath(environmentService.userDataSyncHome, testObject.resource, PREVIEW_DIR_NAME, 'html.json'),
joinPath(environmentService.userDataSyncHome, testObject.resource, PREVIEW_DIR_NAME, 'typescript.json'), joinPath(environmentService.userDataSyncHome, testObject.resource, PREVIEW_DIR_NAME, 'typescript.json'),
]); ]);
assert.deepEqual(testObject.conflicts, []); assert.deepStrictEqual(testObject.conflicts, []);
preview = await testObject.accept(preview!.resourcePreviews[0].previewResource, htmlSnippet2); preview = await testObject.accept(preview!.resourcePreviews[0].previewResource, htmlSnippet2);
preview = await testObject.accept(preview!.resourcePreviews[1].previewResource, tsSnippet2); preview = await testObject.accept(preview!.resourcePreviews[1].previewResource, tsSnippet2);
@ -930,7 +930,7 @@ suite('SnippetsSync', () => {
joinPath(environmentService.userDataSyncHome, testObject.resource, PREVIEW_DIR_NAME, 'html.json'), joinPath(environmentService.userDataSyncHome, testObject.resource, PREVIEW_DIR_NAME, 'html.json'),
joinPath(environmentService.userDataSyncHome, testObject.resource, PREVIEW_DIR_NAME, 'typescript.json'), joinPath(environmentService.userDataSyncHome, testObject.resource, PREVIEW_DIR_NAME, 'typescript.json'),
]); ]);
assert.deepEqual(testObject.conflicts, []); assert.deepStrictEqual(testObject.conflicts, []);
}); });
test('accept when there are multiple snippets with conflicts and all snippets are accepted and applied', async () => { test('accept when there are multiple snippets with conflicts and all snippets are accepted and applied', async () => {
@ -950,7 +950,7 @@ suite('SnippetsSync', () => {
joinPath(environmentService.userDataSyncHome, testObject.resource, PREVIEW_DIR_NAME, 'html.json'), joinPath(environmentService.userDataSyncHome, testObject.resource, PREVIEW_DIR_NAME, 'html.json'),
joinPath(environmentService.userDataSyncHome, testObject.resource, PREVIEW_DIR_NAME, 'typescript.json'), joinPath(environmentService.userDataSyncHome, testObject.resource, PREVIEW_DIR_NAME, 'typescript.json'),
]); ]);
assert.deepEqual(testObject.conflicts, []); assert.deepStrictEqual(testObject.conflicts, []);
preview = await testObject.accept(preview!.resourcePreviews[0].previewResource, htmlSnippet2); preview = await testObject.accept(preview!.resourcePreviews[0].previewResource, htmlSnippet2);
preview = await testObject.accept(preview!.resourcePreviews[1].previewResource, tsSnippet2); preview = await testObject.accept(preview!.resourcePreviews[1].previewResource, tsSnippet2);
@ -958,7 +958,7 @@ suite('SnippetsSync', () => {
assert.strictEqual(testObject.status, SyncStatus.Idle); assert.strictEqual(testObject.status, SyncStatus.Idle);
assert.strictEqual(preview, null); assert.strictEqual(preview, null);
assert.deepEqual(testObject.conflicts, []); assert.deepStrictEqual(testObject.conflicts, []);
}); });
function parseSnippets(content: string): IStringDictionary<string> { function parseSnippets(content: string): IStringDictionary<string> {
@ -992,7 +992,7 @@ suite('SnippetsSync', () => {
} }
function assertPreviews(actual: IResourcePreview[], expected: URI[]) { function assertPreviews(actual: IResourcePreview[], expected: URI[]) {
assert.deepEqual(actual.map(({ previewResource }) => previewResource.toString()), expected.map(uri => uri.toString())); assert.deepStrictEqual(actual.map(({ previewResource }) => previewResource.toString()), expected.map(uri => uri.toString()));
} }
}); });

View file

@ -191,8 +191,8 @@ suite('TestSynchronizer - Auto Sync', () => {
testObject.sync(await client.manifest()); testObject.sync(await client.manifest());
await promise; await promise;
assert.deepEqual(actual, [SyncStatus.Syncing]); assert.deepStrictEqual(actual, [SyncStatus.Syncing]);
assert.deepEqual(testObject.status, SyncStatus.Syncing); assert.deepStrictEqual(testObject.status, SyncStatus.Syncing);
testObject.stop(); testObject.stop();
}); });
@ -205,8 +205,8 @@ suite('TestSynchronizer - Auto Sync', () => {
disposableStore.add(testObject.onDidChangeStatus(status => actual.push(status))); disposableStore.add(testObject.onDidChangeStatus(status => actual.push(status)));
await testObject.sync(await client.manifest()); await testObject.sync(await client.manifest());
assert.deepEqual(actual, [SyncStatus.Syncing, SyncStatus.Idle]); assert.deepStrictEqual(actual, [SyncStatus.Syncing, SyncStatus.Idle]);
assert.deepEqual(testObject.status, SyncStatus.Idle); assert.deepStrictEqual(testObject.status, SyncStatus.Idle);
}); });
test('status is set correctly when sync has errors', async () => { test('status is set correctly when sync has errors', async () => {
@ -221,8 +221,8 @@ suite('TestSynchronizer - Auto Sync', () => {
await testObject.sync(await client.manifest()); await testObject.sync(await client.manifest());
assert.fail('Should fail'); assert.fail('Should fail');
} catch (e) { } catch (e) {
assert.deepEqual(actual, [SyncStatus.Syncing, SyncStatus.Idle]); assert.deepStrictEqual(actual, [SyncStatus.Syncing, SyncStatus.Idle]);
assert.deepEqual(testObject.status, SyncStatus.Idle); assert.deepStrictEqual(testObject.status, SyncStatus.Idle);
} }
}); });
@ -233,7 +233,7 @@ suite('TestSynchronizer - Auto Sync', () => {
await testObject.sync(await client.manifest()); await testObject.sync(await client.manifest());
assert.deepEqual(testObject.status, SyncStatus.HasConflicts); assert.deepStrictEqual(testObject.status, SyncStatus.HasConflicts);
assertConflicts(testObject.conflicts, [testObject.localResource]); assertConflicts(testObject.conflicts, [testObject.localResource]);
}); });
@ -248,8 +248,8 @@ suite('TestSynchronizer - Auto Sync', () => {
disposableStore.add(testObject.onDidChangeStatus(status => actual.push(status))); disposableStore.add(testObject.onDidChangeStatus(status => actual.push(status)));
await testObject.sync(await client.manifest()); await testObject.sync(await client.manifest());
assert.deepEqual(actual, []); assert.deepStrictEqual(actual, []);
assert.deepEqual(testObject.status, SyncStatus.Syncing); assert.deepStrictEqual(testObject.status, SyncStatus.Syncing);
await testObject.stop(); await testObject.stop();
}); });
@ -263,8 +263,8 @@ suite('TestSynchronizer - Auto Sync', () => {
await testObject.sync(await client.manifest()); await testObject.sync(await client.manifest());
assert.deepEqual(actual, []); assert.deepStrictEqual(actual, []);
assert.deepEqual(testObject.status, SyncStatus.Idle); assert.deepStrictEqual(testObject.status, SyncStatus.Idle);
}); });
test('sync should not run if there are conflicts', async () => { test('sync should not run if there are conflicts', async () => {
@ -277,8 +277,8 @@ suite('TestSynchronizer - Auto Sync', () => {
disposableStore.add(testObject.onDidChangeStatus(status => actual.push(status))); disposableStore.add(testObject.onDidChangeStatus(status => actual.push(status)));
await testObject.sync(await client.manifest()); await testObject.sync(await client.manifest());
assert.deepEqual(actual, []); assert.deepStrictEqual(actual, []);
assert.deepEqual(testObject.status, SyncStatus.HasConflicts); assert.deepStrictEqual(testObject.status, SyncStatus.HasConflicts);
}); });
test('accept preview during conflicts', async () => { test('accept preview during conflicts', async () => {
@ -287,14 +287,14 @@ suite('TestSynchronizer - Auto Sync', () => {
testObject.syncBarrier.open(); testObject.syncBarrier.open();
await testObject.sync(await client.manifest()); await testObject.sync(await client.manifest());
assert.deepEqual(testObject.status, SyncStatus.HasConflicts); assert.deepStrictEqual(testObject.status, SyncStatus.HasConflicts);
await testObject.accept(testObject.conflicts[0].previewResource); await testObject.accept(testObject.conflicts[0].previewResource);
assert.deepEqual(testObject.status, SyncStatus.Syncing); assert.deepStrictEqual(testObject.status, SyncStatus.Syncing);
assertConflicts(testObject.conflicts, []); assertConflicts(testObject.conflicts, []);
await testObject.apply(false); await testObject.apply(false);
assert.deepEqual(testObject.status, SyncStatus.Idle); assert.deepStrictEqual(testObject.status, SyncStatus.Idle);
const fileService = client.instantiationService.get(IFileService); const fileService = client.instantiationService.get(IFileService);
assert.strictEqual((await testObject.getRemoteUserData(null)).syncData?.content, (await fileService.readFile(testObject.localResource)).value.toString()); assert.strictEqual((await testObject.getRemoteUserData(null)).syncData?.content, (await fileService.readFile(testObject.localResource)).value.toString());
}); });
@ -310,14 +310,14 @@ suite('TestSynchronizer - Auto Sync', () => {
testObject.syncResult = { hasConflicts: true, hasError: false }; testObject.syncResult = { hasConflicts: true, hasError: false };
await testObject.sync(await client.manifest()); await testObject.sync(await client.manifest());
assert.deepEqual(testObject.status, SyncStatus.HasConflicts); assert.deepStrictEqual(testObject.status, SyncStatus.HasConflicts);
await testObject.accept(testObject.conflicts[0].remoteResource); await testObject.accept(testObject.conflicts[0].remoteResource);
assert.deepEqual(testObject.status, SyncStatus.Syncing); assert.deepStrictEqual(testObject.status, SyncStatus.Syncing);
assertConflicts(testObject.conflicts, []); assertConflicts(testObject.conflicts, []);
await testObject.apply(false); await testObject.apply(false);
assert.deepEqual(testObject.status, SyncStatus.Idle); assert.deepStrictEqual(testObject.status, SyncStatus.Idle);
assert.strictEqual((await testObject.getRemoteUserData(null)).syncData?.content, currentRemoteContent); assert.strictEqual((await testObject.getRemoteUserData(null)).syncData?.content, currentRemoteContent);
assert.strictEqual((await fileService.readFile(testObject.localResource)).value.toString(), currentRemoteContent); assert.strictEqual((await fileService.readFile(testObject.localResource)).value.toString(), currentRemoteContent);
}); });
@ -332,14 +332,14 @@ suite('TestSynchronizer - Auto Sync', () => {
testObject.syncResult = { hasConflicts: true, hasError: false }; testObject.syncResult = { hasConflicts: true, hasError: false };
await testObject.sync(await client.manifest()); await testObject.sync(await client.manifest());
assert.deepEqual(testObject.status, SyncStatus.HasConflicts); assert.deepStrictEqual(testObject.status, SyncStatus.HasConflicts);
await testObject.accept(testObject.conflicts[0].localResource); await testObject.accept(testObject.conflicts[0].localResource);
assert.deepEqual(testObject.status, SyncStatus.Syncing); assert.deepStrictEqual(testObject.status, SyncStatus.Syncing);
assertConflicts(testObject.conflicts, []); assertConflicts(testObject.conflicts, []);
await testObject.apply(false); await testObject.apply(false);
assert.deepEqual(testObject.status, SyncStatus.Idle); assert.deepStrictEqual(testObject.status, SyncStatus.Idle);
assert.strictEqual((await testObject.getRemoteUserData(null)).syncData?.content, newLocalContent); assert.strictEqual((await testObject.getRemoteUserData(null)).syncData?.content, newLocalContent);
assert.strictEqual((await fileService.readFile(testObject.localResource)).value.toString(), newLocalContent); assert.strictEqual((await fileService.readFile(testObject.localResource)).value.toString(), newLocalContent);
}); });
@ -354,15 +354,15 @@ suite('TestSynchronizer - Auto Sync', () => {
testObject.syncResult = { hasConflicts: true, hasError: false }; testObject.syncResult = { hasConflicts: true, hasError: false };
await testObject.sync(await client.manifest()); await testObject.sync(await client.manifest());
assert.deepEqual(testObject.status, SyncStatus.HasConflicts); assert.deepStrictEqual(testObject.status, SyncStatus.HasConflicts);
const mergeContent = 'newContent'; const mergeContent = 'newContent';
await testObject.accept(testObject.conflicts[0].previewResource, mergeContent); await testObject.accept(testObject.conflicts[0].previewResource, mergeContent);
assert.deepEqual(testObject.status, SyncStatus.Syncing); assert.deepStrictEqual(testObject.status, SyncStatus.Syncing);
assertConflicts(testObject.conflicts, []); assertConflicts(testObject.conflicts, []);
await testObject.apply(false); await testObject.apply(false);
assert.deepEqual(testObject.status, SyncStatus.Idle); assert.deepStrictEqual(testObject.status, SyncStatus.Idle);
assert.strictEqual((await testObject.getRemoteUserData(null)).syncData?.content, mergeContent); assert.strictEqual((await testObject.getRemoteUserData(null)).syncData?.content, mergeContent);
assert.strictEqual((await fileService.readFile(testObject.localResource)).value.toString(), mergeContent); assert.strictEqual((await fileService.readFile(testObject.localResource)).value.toString(), mergeContent);
}); });
@ -377,14 +377,14 @@ suite('TestSynchronizer - Auto Sync', () => {
testObject.syncResult = { hasConflicts: true, hasError: false }; testObject.syncResult = { hasConflicts: true, hasError: false };
await testObject.sync(await client.manifest()); await testObject.sync(await client.manifest());
assert.deepEqual(testObject.status, SyncStatus.HasConflicts); assert.deepStrictEqual(testObject.status, SyncStatus.HasConflicts);
await testObject.accept(testObject.conflicts[0].previewResource, null); await testObject.accept(testObject.conflicts[0].previewResource, null);
assert.deepEqual(testObject.status, SyncStatus.Syncing); assert.deepStrictEqual(testObject.status, SyncStatus.Syncing);
assertConflicts(testObject.conflicts, []); assertConflicts(testObject.conflicts, []);
await testObject.apply(false); await testObject.apply(false);
assert.deepEqual(testObject.status, SyncStatus.Idle); assert.deepStrictEqual(testObject.status, SyncStatus.Idle);
assert.strictEqual((await testObject.getRemoteUserData(null)).syncData?.content, ''); assert.strictEqual((await testObject.getRemoteUserData(null)).syncData?.content, '');
assert.ok(!(await fileService.exists(testObject.localResource))); assert.ok(!(await fileService.exists(testObject.localResource)));
}); });
@ -398,14 +398,14 @@ suite('TestSynchronizer - Auto Sync', () => {
testObject.syncResult = { hasConflicts: true, hasError: false }; testObject.syncResult = { hasConflicts: true, hasError: false };
await testObject.sync(await client.manifest()); await testObject.sync(await client.manifest());
assert.deepEqual(testObject.status, SyncStatus.HasConflicts); assert.deepStrictEqual(testObject.status, SyncStatus.HasConflicts);
await testObject.accept(testObject.conflicts[0].localResource); await testObject.accept(testObject.conflicts[0].localResource);
assert.deepEqual(testObject.status, SyncStatus.Syncing); assert.deepStrictEqual(testObject.status, SyncStatus.Syncing);
assertConflicts(testObject.conflicts, []); assertConflicts(testObject.conflicts, []);
await testObject.apply(false); await testObject.apply(false);
assert.deepEqual(testObject.status, SyncStatus.Idle); assert.deepStrictEqual(testObject.status, SyncStatus.Idle);
assert.strictEqual((await testObject.getRemoteUserData(null)).syncData?.content, ''); assert.strictEqual((await testObject.getRemoteUserData(null)).syncData?.content, '');
assert.ok(!(await fileService.exists(testObject.localResource))); assert.ok(!(await fileService.exists(testObject.localResource)));
}); });
@ -418,14 +418,14 @@ suite('TestSynchronizer - Auto Sync', () => {
testObject.syncResult = { hasConflicts: true, hasError: false }; testObject.syncResult = { hasConflicts: true, hasError: false };
await testObject.sync(await client.manifest()); await testObject.sync(await client.manifest());
assert.deepEqual(testObject.status, SyncStatus.HasConflicts); assert.deepStrictEqual(testObject.status, SyncStatus.HasConflicts);
await testObject.accept(testObject.conflicts[0].remoteResource); await testObject.accept(testObject.conflicts[0].remoteResource);
assert.deepEqual(testObject.status, SyncStatus.Syncing); assert.deepStrictEqual(testObject.status, SyncStatus.Syncing);
assertConflicts(testObject.conflicts, []); assertConflicts(testObject.conflicts, []);
await testObject.apply(false); await testObject.apply(false);
assert.deepEqual(testObject.status, SyncStatus.Idle); assert.deepStrictEqual(testObject.status, SyncStatus.Idle);
assert.strictEqual((await testObject.getRemoteUserData(null)).syncData, null); assert.strictEqual((await testObject.getRemoteUserData(null)).syncData, null);
assert.ok(!(await fileService.exists(testObject.localResource))); assert.ok(!(await fileService.exists(testObject.localResource)));
}); });
@ -450,7 +450,7 @@ suite('TestSynchronizer - Auto Sync', () => {
const ref = manifest!.latest![testObject.resource]; const ref = manifest!.latest![testObject.resource];
await testObject.sync(await client.manifest()); await testObject.sync(await client.manifest());
assert.deepEqual(server.requests, [ assert.deepStrictEqual(server.requests, [
{ type: 'POST', url: `${server.url}/v1/resource/${testObject.resource}`, headers: { 'If-Match': ref } }, { type: 'POST', url: `${server.url}/v1/resource/${testObject.resource}`, headers: { 'If-Match': ref } },
{ type: 'GET', url: `${server.url}/v1/resource/${testObject.resource}/latest`, headers: {} }, { type: 'GET', url: `${server.url}/v1/resource/${testObject.resource}/latest`, headers: {} },
{ type: 'POST', url: `${server.url}/v1/resource/${testObject.resource}`, headers: { 'If-Match': `${parseInt(ref) + 1}` } }, { type: 'POST', url: `${server.url}/v1/resource/${testObject.resource}`, headers: { 'If-Match': `${parseInt(ref) + 1}` } },
@ -467,7 +467,7 @@ suite('TestSynchronizer - Auto Sync', () => {
await testObject.triggerLocalChange(); await testObject.triggerLocalChange();
await promise; await promise;
assert.deepEqual(server.requests, []); assert.deepStrictEqual(server.requests, []);
}); });
test('status is reset when getting latest remote data fails', async () => { test('status is reset when getting latest remote data fails', async () => {
@ -508,7 +508,7 @@ suite('TestSynchronizer - Manual Sync', () => {
const preview = await testObject.preview(await client.manifest()); const preview = await testObject.preview(await client.manifest());
assert.deepEqual(testObject.status, SyncStatus.Syncing); assert.deepStrictEqual(testObject.status, SyncStatus.Syncing);
assertPreviews(preview!.resourcePreviews, [testObject.localResource]); assertPreviews(preview!.resourcePreviews, [testObject.localResource]);
assertConflicts(testObject.conflicts, []); assertConflicts(testObject.conflicts, []);
}); });
@ -521,7 +521,7 @@ suite('TestSynchronizer - Manual Sync', () => {
let preview = await testObject.preview(await client.manifest()); let preview = await testObject.preview(await client.manifest());
preview = await testObject.merge(preview!.resourcePreviews[0].previewResource); preview = await testObject.merge(preview!.resourcePreviews[0].previewResource);
assert.deepEqual(testObject.status, SyncStatus.Syncing); assert.deepStrictEqual(testObject.status, SyncStatus.Syncing);
assertPreviews(preview!.resourcePreviews, [testObject.localResource]); assertPreviews(preview!.resourcePreviews, [testObject.localResource]);
assert.strictEqual(preview!.resourcePreviews[0].mergeState, MergeState.Accepted); assert.strictEqual(preview!.resourcePreviews[0].mergeState, MergeState.Accepted);
assertConflicts(testObject.conflicts, []); assertConflicts(testObject.conflicts, []);
@ -535,7 +535,7 @@ suite('TestSynchronizer - Manual Sync', () => {
let preview = await testObject.preview(await client.manifest()); let preview = await testObject.preview(await client.manifest());
preview = await testObject.accept(preview!.resourcePreviews[0].previewResource); preview = await testObject.accept(preview!.resourcePreviews[0].previewResource);
assert.deepEqual(testObject.status, SyncStatus.Syncing); assert.deepStrictEqual(testObject.status, SyncStatus.Syncing);
assertPreviews(preview!.resourcePreviews, [testObject.localResource]); assertPreviews(preview!.resourcePreviews, [testObject.localResource]);
assert.strictEqual(preview!.resourcePreviews[0].mergeState, MergeState.Accepted); assert.strictEqual(preview!.resourcePreviews[0].mergeState, MergeState.Accepted);
assertConflicts(testObject.conflicts, []); assertConflicts(testObject.conflicts, []);
@ -550,7 +550,7 @@ suite('TestSynchronizer - Manual Sync', () => {
preview = await testObject.merge(preview!.resourcePreviews[0].previewResource); preview = await testObject.merge(preview!.resourcePreviews[0].previewResource);
preview = await testObject.accept(preview!.resourcePreviews[0].localResource); preview = await testObject.accept(preview!.resourcePreviews[0].localResource);
assert.deepEqual(testObject.status, SyncStatus.Syncing); assert.deepStrictEqual(testObject.status, SyncStatus.Syncing);
assertPreviews(preview!.resourcePreviews, [testObject.localResource]); assertPreviews(preview!.resourcePreviews, [testObject.localResource]);
assert.strictEqual(preview!.resourcePreviews[0].mergeState, MergeState.Accepted); assert.strictEqual(preview!.resourcePreviews[0].mergeState, MergeState.Accepted);
assertConflicts(testObject.conflicts, []); assertConflicts(testObject.conflicts, []);
@ -567,7 +567,7 @@ suite('TestSynchronizer - Manual Sync', () => {
preview = await testObject.merge(preview!.resourcePreviews[0].previewResource); preview = await testObject.merge(preview!.resourcePreviews[0].previewResource);
preview = await testObject.apply(false); preview = await testObject.apply(false);
assert.deepEqual(testObject.status, SyncStatus.Idle); assert.deepStrictEqual(testObject.status, SyncStatus.Idle);
assert.strictEqual(preview, null); assert.strictEqual(preview, null);
assertConflicts(testObject.conflicts, []); assertConflicts(testObject.conflicts, []);
@ -588,7 +588,7 @@ suite('TestSynchronizer - Manual Sync', () => {
preview = await testObject.accept(preview!.resourcePreviews[0].previewResource); preview = await testObject.accept(preview!.resourcePreviews[0].previewResource);
preview = await testObject.apply(false); preview = await testObject.apply(false);
assert.deepEqual(testObject.status, SyncStatus.Idle); assert.deepStrictEqual(testObject.status, SyncStatus.Idle);
assert.strictEqual(preview, null); assert.strictEqual(preview, null);
assertConflicts(testObject.conflicts, []); assertConflicts(testObject.conflicts, []);
@ -608,7 +608,7 @@ suite('TestSynchronizer - Manual Sync', () => {
preview = await testObject.accept(preview!.resourcePreviews[0].localResource); preview = await testObject.accept(preview!.resourcePreviews[0].localResource);
preview = await testObject.apply(false); preview = await testObject.apply(false);
assert.deepEqual(testObject.status, SyncStatus.Idle); assert.deepStrictEqual(testObject.status, SyncStatus.Idle);
assert.strictEqual(preview, null); assert.strictEqual(preview, null);
assertConflicts(testObject.conflicts, []); assertConflicts(testObject.conflicts, []);
@ -624,7 +624,7 @@ suite('TestSynchronizer - Manual Sync', () => {
let preview = await testObject.preview(await client.manifest()); let preview = await testObject.preview(await client.manifest());
preview = await testObject.accept(preview!.resourcePreviews[0].previewResource); preview = await testObject.accept(preview!.resourcePreviews[0].previewResource);
assert.deepEqual(testObject.status, SyncStatus.Syncing); assert.deepStrictEqual(testObject.status, SyncStatus.Syncing);
assertPreviews(preview!.resourcePreviews, [testObject.localResource]); assertPreviews(preview!.resourcePreviews, [testObject.localResource]);
assertConflicts(testObject.conflicts, []); assertConflicts(testObject.conflicts, []);
}); });
@ -641,7 +641,7 @@ suite('TestSynchronizer - Manual Sync', () => {
preview = await testObject.accept(preview!.resourcePreviews[0].previewResource); preview = await testObject.accept(preview!.resourcePreviews[0].previewResource);
preview = await testObject.apply(false); preview = await testObject.apply(false);
assert.deepEqual(testObject.status, SyncStatus.Idle); assert.deepStrictEqual(testObject.status, SyncStatus.Idle);
assert.strictEqual(preview, null); assert.strictEqual(preview, null);
assertConflicts(testObject.conflicts, []); assertConflicts(testObject.conflicts, []);
@ -658,7 +658,7 @@ suite('TestSynchronizer - Manual Sync', () => {
preview = await testObject.merge(preview!.resourcePreviews[0].previewResource); preview = await testObject.merge(preview!.resourcePreviews[0].previewResource);
preview = await testObject.discard(preview!.resourcePreviews[0].previewResource); preview = await testObject.discard(preview!.resourcePreviews[0].previewResource);
assert.deepEqual(testObject.status, SyncStatus.Syncing); assert.deepStrictEqual(testObject.status, SyncStatus.Syncing);
assertPreviews(preview!.resourcePreviews, [testObject.localResource]); assertPreviews(preview!.resourcePreviews, [testObject.localResource]);
assert.strictEqual(preview!.resourcePreviews[0].mergeState, MergeState.Preview); assert.strictEqual(preview!.resourcePreviews[0].mergeState, MergeState.Preview);
assertConflicts(testObject.conflicts, []); assertConflicts(testObject.conflicts, []);
@ -674,7 +674,7 @@ suite('TestSynchronizer - Manual Sync', () => {
preview = await testObject.discard(preview!.resourcePreviews[0].previewResource); preview = await testObject.discard(preview!.resourcePreviews[0].previewResource);
preview = await testObject.accept(preview!.resourcePreviews[0].remoteResource); preview = await testObject.accept(preview!.resourcePreviews[0].remoteResource);
assert.deepEqual(testObject.status, SyncStatus.Syncing); assert.deepStrictEqual(testObject.status, SyncStatus.Syncing);
assertPreviews(preview!.resourcePreviews, [testObject.localResource]); assertPreviews(preview!.resourcePreviews, [testObject.localResource]);
assert.strictEqual(preview!.resourcePreviews[0].mergeState, MergeState.Accepted); assert.strictEqual(preview!.resourcePreviews[0].mergeState, MergeState.Accepted);
assertConflicts(testObject.conflicts, []); assertConflicts(testObject.conflicts, []);
@ -689,7 +689,7 @@ suite('TestSynchronizer - Manual Sync', () => {
preview = await testObject.accept(preview!.resourcePreviews[0].previewResource); preview = await testObject.accept(preview!.resourcePreviews[0].previewResource);
preview = await testObject.discard(preview!.resourcePreviews[0].previewResource); preview = await testObject.discard(preview!.resourcePreviews[0].previewResource);
assert.deepEqual(testObject.status, SyncStatus.Syncing); assert.deepStrictEqual(testObject.status, SyncStatus.Syncing);
assertPreviews(preview!.resourcePreviews, [testObject.localResource]); assertPreviews(preview!.resourcePreviews, [testObject.localResource]);
assert.strictEqual(preview!.resourcePreviews[0].mergeState, MergeState.Preview); assert.strictEqual(preview!.resourcePreviews[0].mergeState, MergeState.Preview);
assertConflicts(testObject.conflicts, []); assertConflicts(testObject.conflicts, []);
@ -705,7 +705,7 @@ suite('TestSynchronizer - Manual Sync', () => {
preview = await testObject.discard(preview!.resourcePreviews[0].previewResource); preview = await testObject.discard(preview!.resourcePreviews[0].previewResource);
preview = await testObject.accept(preview!.resourcePreviews[0].remoteResource); preview = await testObject.accept(preview!.resourcePreviews[0].remoteResource);
assert.deepEqual(testObject.status, SyncStatus.Syncing); assert.deepStrictEqual(testObject.status, SyncStatus.Syncing);
assertPreviews(preview!.resourcePreviews, [testObject.localResource]); assertPreviews(preview!.resourcePreviews, [testObject.localResource]);
assert.strictEqual(preview!.resourcePreviews[0].mergeState, MergeState.Accepted); assert.strictEqual(preview!.resourcePreviews[0].mergeState, MergeState.Accepted);
assertConflicts(testObject.conflicts, []); assertConflicts(testObject.conflicts, []);
@ -721,7 +721,7 @@ suite('TestSynchronizer - Manual Sync', () => {
preview = await testObject.discard(preview!.resourcePreviews[0].previewResource); preview = await testObject.discard(preview!.resourcePreviews[0].previewResource);
preview = await testObject.merge(preview!.resourcePreviews[0].remoteResource); preview = await testObject.merge(preview!.resourcePreviews[0].remoteResource);
assert.deepEqual(testObject.status, SyncStatus.Syncing); assert.deepStrictEqual(testObject.status, SyncStatus.Syncing);
assertPreviews(preview!.resourcePreviews, [testObject.localResource]); assertPreviews(preview!.resourcePreviews, [testObject.localResource]);
assert.strictEqual(preview!.resourcePreviews[0].mergeState, MergeState.Accepted); assert.strictEqual(preview!.resourcePreviews[0].mergeState, MergeState.Accepted);
assertConflicts(testObject.conflicts, []); assertConflicts(testObject.conflicts, []);
@ -737,7 +737,7 @@ suite('TestSynchronizer - Manual Sync', () => {
preview = await testObject.accept(preview!.resourcePreviews[0].remoteResource); preview = await testObject.accept(preview!.resourcePreviews[0].remoteResource);
preview = await testObject.discard(preview!.resourcePreviews[0].previewResource); preview = await testObject.discard(preview!.resourcePreviews[0].previewResource);
assert.deepEqual(testObject.status, SyncStatus.Syncing); assert.deepStrictEqual(testObject.status, SyncStatus.Syncing);
assertPreviews(preview!.resourcePreviews, [testObject.localResource]); assertPreviews(preview!.resourcePreviews, [testObject.localResource]);
assert.strictEqual(preview!.resourcePreviews[0].mergeState, MergeState.Preview); assert.strictEqual(preview!.resourcePreviews[0].mergeState, MergeState.Preview);
assertConflicts(testObject.conflicts, []); assertConflicts(testObject.conflicts, []);
@ -756,7 +756,7 @@ suite('TestSynchronizer - Manual Sync', () => {
preview = await testObject.accept(preview!.resourcePreviews[0].localResource); preview = await testObject.accept(preview!.resourcePreviews[0].localResource);
preview = await testObject.apply(false); preview = await testObject.apply(false);
assert.deepEqual(testObject.status, SyncStatus.Idle); assert.deepStrictEqual(testObject.status, SyncStatus.Idle);
assert.strictEqual(preview, null); assert.strictEqual(preview, null);
assertConflicts(testObject.conflicts, []); assertConflicts(testObject.conflicts, []);
assert.strictEqual((await testObject.getRemoteUserData(null)).syncData?.content, expectedContent); assert.strictEqual((await testObject.getRemoteUserData(null)).syncData?.content, expectedContent);
@ -777,7 +777,7 @@ suite('TestSynchronizer - Manual Sync', () => {
preview = await testObject.accept(preview!.resourcePreviews[0].localResource); preview = await testObject.accept(preview!.resourcePreviews[0].localResource);
preview = await testObject.apply(false); preview = await testObject.apply(false);
assert.deepEqual(testObject.status, SyncStatus.Idle); assert.deepStrictEqual(testObject.status, SyncStatus.Idle);
assert.strictEqual(preview, null); assert.strictEqual(preview, null);
assertConflicts(testObject.conflicts, []); assertConflicts(testObject.conflicts, []);
assert.strictEqual((await testObject.getRemoteUserData(null)).syncData?.content, expectedContent); assert.strictEqual((await testObject.getRemoteUserData(null)).syncData?.content, expectedContent);
@ -799,7 +799,7 @@ suite('TestSynchronizer - Manual Sync', () => {
preview = await testObject.merge(preview!.resourcePreviews[0].localResource); preview = await testObject.merge(preview!.resourcePreviews[0].localResource);
preview = await testObject.apply(false); preview = await testObject.apply(false);
assert.deepEqual(testObject.status, SyncStatus.Idle); assert.deepStrictEqual(testObject.status, SyncStatus.Idle);
assert.strictEqual(preview, null); assert.strictEqual(preview, null);
assertConflicts(testObject.conflicts, []); assertConflicts(testObject.conflicts, []);
@ -814,7 +814,7 @@ suite('TestSynchronizer - Manual Sync', () => {
const preview = await testObject.preview(await client.manifest()); const preview = await testObject.preview(await client.manifest());
assert.deepEqual(testObject.status, SyncStatus.Syncing); assert.deepStrictEqual(testObject.status, SyncStatus.Syncing);
assertPreviews(preview!.resourcePreviews, [testObject.localResource]); assertPreviews(preview!.resourcePreviews, [testObject.localResource]);
assertConflicts(testObject.conflicts, []); assertConflicts(testObject.conflicts, []);
}); });
@ -827,7 +827,7 @@ suite('TestSynchronizer - Manual Sync', () => {
let preview = await testObject.preview(await client.manifest()); let preview = await testObject.preview(await client.manifest());
preview = await testObject.merge(preview!.resourcePreviews[0].previewResource); preview = await testObject.merge(preview!.resourcePreviews[0].previewResource);
assert.deepEqual(testObject.status, SyncStatus.HasConflicts); assert.deepStrictEqual(testObject.status, SyncStatus.HasConflicts);
assertPreviews(preview!.resourcePreviews, [testObject.localResource]); assertPreviews(preview!.resourcePreviews, [testObject.localResource]);
assert.strictEqual(preview!.resourcePreviews[0].mergeState, MergeState.Conflict); assert.strictEqual(preview!.resourcePreviews[0].mergeState, MergeState.Conflict);
assertConflicts(testObject.conflicts, [preview!.resourcePreviews[0].localResource]); assertConflicts(testObject.conflicts, [preview!.resourcePreviews[0].localResource]);
@ -842,7 +842,7 @@ suite('TestSynchronizer - Manual Sync', () => {
await testObject.merge(preview!.resourcePreviews[0].previewResource); await testObject.merge(preview!.resourcePreviews[0].previewResource);
await testObject.discard(preview!.resourcePreviews[0].previewResource); await testObject.discard(preview!.resourcePreviews[0].previewResource);
assert.deepEqual(testObject.status, SyncStatus.Syncing); assert.deepStrictEqual(testObject.status, SyncStatus.Syncing);
assertPreviews(preview!.resourcePreviews, [testObject.localResource]); assertPreviews(preview!.resourcePreviews, [testObject.localResource]);
assert.strictEqual(preview!.resourcePreviews[0].mergeState, MergeState.Preview); assert.strictEqual(preview!.resourcePreviews[0].mergeState, MergeState.Preview);
assertConflicts(testObject.conflicts, []); assertConflicts(testObject.conflicts, []);
@ -858,9 +858,9 @@ suite('TestSynchronizer - Manual Sync', () => {
const content = await testObject.resolveContent(preview!.resourcePreviews[0].previewResource); const content = await testObject.resolveContent(preview!.resourcePreviews[0].previewResource);
preview = await testObject.accept(preview!.resourcePreviews[0].previewResource, content); preview = await testObject.accept(preview!.resourcePreviews[0].previewResource, content);
assert.deepEqual(testObject.status, SyncStatus.Syncing); assert.deepStrictEqual(testObject.status, SyncStatus.Syncing);
assertPreviews(preview!.resourcePreviews, [testObject.localResource]); assertPreviews(preview!.resourcePreviews, [testObject.localResource]);
assert.deepEqual(testObject.conflicts, []); assert.deepStrictEqual(testObject.conflicts, []);
}); });
test('conflicts: preview -> merge -> accept -> apply', async () => { test('conflicts: preview -> merge -> accept -> apply', async () => {
@ -878,7 +878,7 @@ suite('TestSynchronizer - Manual Sync', () => {
preview = await testObject.accept(preview!.resourcePreviews[0].previewResource); preview = await testObject.accept(preview!.resourcePreviews[0].previewResource);
preview = await testObject.apply(false); preview = await testObject.apply(false);
assert.deepEqual(testObject.status, SyncStatus.Idle); assert.deepStrictEqual(testObject.status, SyncStatus.Idle);
assert.strictEqual(preview, null); assert.strictEqual(preview, null);
assertConflicts(testObject.conflicts, []); assertConflicts(testObject.conflicts, []);
@ -895,7 +895,7 @@ suite('TestSynchronizer - Manual Sync', () => {
const content = await testObject.resolveContent(preview!.resourcePreviews[0].previewResource); const content = await testObject.resolveContent(preview!.resourcePreviews[0].previewResource);
preview = await testObject.accept(preview!.resourcePreviews[0].previewResource, content); preview = await testObject.accept(preview!.resourcePreviews[0].previewResource, content);
assert.deepEqual(testObject.status, SyncStatus.Syncing); assert.deepStrictEqual(testObject.status, SyncStatus.Syncing);
assertPreviews(preview!.resourcePreviews, [testObject.localResource]); assertPreviews(preview!.resourcePreviews, [testObject.localResource]);
assertConflicts(testObject.conflicts, []); assertConflicts(testObject.conflicts, []);
}); });
@ -914,7 +914,7 @@ suite('TestSynchronizer - Manual Sync', () => {
preview = await testObject.accept(preview!.resourcePreviews[0].previewResource); preview = await testObject.accept(preview!.resourcePreviews[0].previewResource);
preview = await testObject.apply(false); preview = await testObject.apply(false);
assert.deepEqual(testObject.status, SyncStatus.Idle); assert.deepStrictEqual(testObject.status, SyncStatus.Idle);
assert.strictEqual(preview, null); assert.strictEqual(preview, null);
assertConflicts(testObject.conflicts, []); assertConflicts(testObject.conflicts, []);
@ -931,7 +931,7 @@ suite('TestSynchronizer - Manual Sync', () => {
preview = await testObject.merge(preview!.resourcePreviews[0].previewResource); preview = await testObject.merge(preview!.resourcePreviews[0].previewResource);
preview = await testObject.discard(preview!.resourcePreviews[0].previewResource); preview = await testObject.discard(preview!.resourcePreviews[0].previewResource);
assert.deepEqual(testObject.status, SyncStatus.Syncing); assert.deepStrictEqual(testObject.status, SyncStatus.Syncing);
assertPreviews(preview!.resourcePreviews, [testObject.localResource]); assertPreviews(preview!.resourcePreviews, [testObject.localResource]);
assert.strictEqual(preview!.resourcePreviews[0].mergeState, MergeState.Preview); assert.strictEqual(preview!.resourcePreviews[0].mergeState, MergeState.Preview);
assertConflicts(testObject.conflicts, []); assertConflicts(testObject.conflicts, []);
@ -947,7 +947,7 @@ suite('TestSynchronizer - Manual Sync', () => {
preview = await testObject.discard(preview!.resourcePreviews[0].previewResource); preview = await testObject.discard(preview!.resourcePreviews[0].previewResource);
preview = await testObject.accept(preview!.resourcePreviews[0].remoteResource); preview = await testObject.accept(preview!.resourcePreviews[0].remoteResource);
assert.deepEqual(testObject.status, SyncStatus.Syncing); assert.deepStrictEqual(testObject.status, SyncStatus.Syncing);
assertPreviews(preview!.resourcePreviews, [testObject.localResource]); assertPreviews(preview!.resourcePreviews, [testObject.localResource]);
assert.strictEqual(preview!.resourcePreviews[0].mergeState, MergeState.Accepted); assert.strictEqual(preview!.resourcePreviews[0].mergeState, MergeState.Accepted);
assertConflicts(testObject.conflicts, []); assertConflicts(testObject.conflicts, []);
@ -962,7 +962,7 @@ suite('TestSynchronizer - Manual Sync', () => {
preview = await testObject.accept(preview!.resourcePreviews[0].previewResource); preview = await testObject.accept(preview!.resourcePreviews[0].previewResource);
preview = await testObject.discard(preview!.resourcePreviews[0].previewResource); preview = await testObject.discard(preview!.resourcePreviews[0].previewResource);
assert.deepEqual(testObject.status, SyncStatus.Syncing); assert.deepStrictEqual(testObject.status, SyncStatus.Syncing);
assertPreviews(preview!.resourcePreviews, [testObject.localResource]); assertPreviews(preview!.resourcePreviews, [testObject.localResource]);
assert.strictEqual(preview!.resourcePreviews[0].mergeState, MergeState.Preview); assert.strictEqual(preview!.resourcePreviews[0].mergeState, MergeState.Preview);
assertConflicts(testObject.conflicts, []); assertConflicts(testObject.conflicts, []);
@ -978,7 +978,7 @@ suite('TestSynchronizer - Manual Sync', () => {
preview = await testObject.discard(preview!.resourcePreviews[0].previewResource); preview = await testObject.discard(preview!.resourcePreviews[0].previewResource);
preview = await testObject.accept(preview!.resourcePreviews[0].remoteResource); preview = await testObject.accept(preview!.resourcePreviews[0].remoteResource);
assert.deepEqual(testObject.status, SyncStatus.Syncing); assert.deepStrictEqual(testObject.status, SyncStatus.Syncing);
assertPreviews(preview!.resourcePreviews, [testObject.localResource]); assertPreviews(preview!.resourcePreviews, [testObject.localResource]);
assert.strictEqual(preview!.resourcePreviews[0].mergeState, MergeState.Accepted); assert.strictEqual(preview!.resourcePreviews[0].mergeState, MergeState.Accepted);
assertConflicts(testObject.conflicts, []); assertConflicts(testObject.conflicts, []);
@ -994,7 +994,7 @@ suite('TestSynchronizer - Manual Sync', () => {
preview = await testObject.discard(preview!.resourcePreviews[0].previewResource); preview = await testObject.discard(preview!.resourcePreviews[0].previewResource);
preview = await testObject.merge(preview!.resourcePreviews[0].remoteResource); preview = await testObject.merge(preview!.resourcePreviews[0].remoteResource);
assert.deepEqual(testObject.status, SyncStatus.HasConflicts); assert.deepStrictEqual(testObject.status, SyncStatus.HasConflicts);
assertPreviews(preview!.resourcePreviews, [testObject.localResource]); assertPreviews(preview!.resourcePreviews, [testObject.localResource]);
assert.strictEqual(preview!.resourcePreviews[0].mergeState, MergeState.Conflict); assert.strictEqual(preview!.resourcePreviews[0].mergeState, MergeState.Conflict);
assertConflicts(testObject.conflicts, [preview!.resourcePreviews[0].localResource]); assertConflicts(testObject.conflicts, [preview!.resourcePreviews[0].localResource]);
@ -1010,7 +1010,7 @@ suite('TestSynchronizer - Manual Sync', () => {
preview = await testObject.discard(preview!.resourcePreviews[0].previewResource); preview = await testObject.discard(preview!.resourcePreviews[0].previewResource);
preview = await testObject.merge(preview!.resourcePreviews[0].remoteResource); preview = await testObject.merge(preview!.resourcePreviews[0].remoteResource);
assert.deepEqual(testObject.status, SyncStatus.HasConflicts); assert.deepStrictEqual(testObject.status, SyncStatus.HasConflicts);
assertPreviews(preview!.resourcePreviews, [testObject.localResource]); assertPreviews(preview!.resourcePreviews, [testObject.localResource]);
assert.strictEqual(preview!.resourcePreviews[0].mergeState, MergeState.Conflict); assert.strictEqual(preview!.resourcePreviews[0].mergeState, MergeState.Conflict);
assertConflicts(testObject.conflicts, [preview!.resourcePreviews[0].localResource]); assertConflicts(testObject.conflicts, [preview!.resourcePreviews[0].localResource]);
@ -1026,7 +1026,7 @@ suite('TestSynchronizer - Manual Sync', () => {
preview = await testObject.accept(preview!.resourcePreviews[0].remoteResource); preview = await testObject.accept(preview!.resourcePreviews[0].remoteResource);
preview = await testObject.discard(preview!.resourcePreviews[0].previewResource); preview = await testObject.discard(preview!.resourcePreviews[0].previewResource);
assert.deepEqual(testObject.status, SyncStatus.Syncing); assert.deepStrictEqual(testObject.status, SyncStatus.Syncing);
assertPreviews(preview!.resourcePreviews, [testObject.localResource]); assertPreviews(preview!.resourcePreviews, [testObject.localResource]);
assert.strictEqual(preview!.resourcePreviews[0].mergeState, MergeState.Preview); assert.strictEqual(preview!.resourcePreviews[0].mergeState, MergeState.Preview);
assertConflicts(testObject.conflicts, []); assertConflicts(testObject.conflicts, []);
@ -1045,7 +1045,7 @@ suite('TestSynchronizer - Manual Sync', () => {
preview = await testObject.accept(preview!.resourcePreviews[0].localResource); preview = await testObject.accept(preview!.resourcePreviews[0].localResource);
preview = await testObject.apply(false); preview = await testObject.apply(false);
assert.deepEqual(testObject.status, SyncStatus.Idle); assert.deepStrictEqual(testObject.status, SyncStatus.Idle);
assert.strictEqual(preview, null); assert.strictEqual(preview, null);
assertConflicts(testObject.conflicts, []); assertConflicts(testObject.conflicts, []);
assert.strictEqual((await testObject.getRemoteUserData(null)).syncData?.content, expectedContent); assert.strictEqual((await testObject.getRemoteUserData(null)).syncData?.content, expectedContent);
@ -1066,7 +1066,7 @@ suite('TestSynchronizer - Manual Sync', () => {
preview = await testObject.accept(preview!.resourcePreviews[0].localResource); preview = await testObject.accept(preview!.resourcePreviews[0].localResource);
preview = await testObject.apply(false); preview = await testObject.apply(false);
assert.deepEqual(testObject.status, SyncStatus.Idle); assert.deepStrictEqual(testObject.status, SyncStatus.Idle);
assert.strictEqual(preview, null); assert.strictEqual(preview, null);
assertConflicts(testObject.conflicts, []); assertConflicts(testObject.conflicts, []);
assert.strictEqual((await testObject.getRemoteUserData(null)).syncData?.content, expectedContent); assert.strictEqual((await testObject.getRemoteUserData(null)).syncData?.content, expectedContent);
@ -1076,9 +1076,9 @@ suite('TestSynchronizer - Manual Sync', () => {
}); });
function assertConflicts(actual: IBaseResourcePreview[], expected: URI[]) { function assertConflicts(actual: IBaseResourcePreview[], expected: URI[]) {
assert.deepEqual(actual.map(({ localResource }) => localResource.toString()), expected.map(uri => uri.toString())); assert.deepStrictEqual(actual.map(({ localResource }) => localResource.toString()), expected.map(uri => uri.toString()));
} }
function assertPreviews(actual: IBaseResourcePreview[], expected: URI[]) { function assertPreviews(actual: IBaseResourcePreview[], expected: URI[]) {
assert.deepEqual(actual.map(({ localResource }) => localResource.toString()), expected.map(uri => uri.toString())); assert.deepStrictEqual(actual.map(({ localResource }) => localResource.toString()), expected.map(uri => uri.toString()));
} }

View file

@ -49,7 +49,7 @@ suite('UserDataAutoSyncService', () => {
const actual = target.requests.filter(request => !request.url.startsWith(`${target.url}/v1/resource/machines`)); const actual = target.requests.filter(request => !request.url.startsWith(`${target.url}/v1/resource/machines`));
// Make sure only one manifest request is made // Make sure only one manifest request is made
assert.deepEqual(actual, [{ type: 'GET', url: `${target.url}/v1/manifest`, headers: {} }]); assert.deepStrictEqual(actual, [{ type: 'GET', url: `${target.url}/v1/manifest`, headers: {} }]);
}); });
test('test auto sync with sync resource change triggers sync for every change', async () => { test('test auto sync with sync resource change triggers sync for every change', async () => {
@ -72,7 +72,7 @@ suite('UserDataAutoSyncService', () => {
// Filter out machine requests // Filter out machine requests
const actual = target.requests.filter(request => !request.url.startsWith(`${target.url}/v1/resource/machines`)); const actual = target.requests.filter(request => !request.url.startsWith(`${target.url}/v1/resource/machines`));
assert.deepEqual(actual, [ assert.deepStrictEqual(actual, [
{ type: 'GET', url: `${target.url}/v1/manifest`, headers: {} }, { type: 'GET', url: `${target.url}/v1/manifest`, headers: {} },
{ type: 'GET', url: `${target.url}/v1/manifest`, headers: {} } { type: 'GET', url: `${target.url}/v1/manifest`, headers: {} }
]); ]);
@ -97,7 +97,7 @@ suite('UserDataAutoSyncService', () => {
const actual = target.requests.filter(request => !request.url.startsWith(`${target.url}/v1/resource/machines`)); const actual = target.requests.filter(request => !request.url.startsWith(`${target.url}/v1/resource/machines`));
// Make sure only one manifest request is made // Make sure only one manifest request is made
assert.deepEqual(actual, [{ type: 'GET', url: `${target.url}/v1/manifest`, headers: {} }]); assert.deepStrictEqual(actual, [{ type: 'GET', url: `${target.url}/v1/manifest`, headers: {} }]);
}); });
test('test auto sync with non sync resource change does not trigger continuous syncs', async () => { test('test auto sync with non sync resource change does not trigger continuous syncs', async () => {
@ -121,7 +121,7 @@ suite('UserDataAutoSyncService', () => {
const actual = target.requests.filter(request => !request.url.startsWith(`${target.url}/v1/resource/machines`)); const actual = target.requests.filter(request => !request.url.startsWith(`${target.url}/v1/resource/machines`));
// Make sure only one manifest request is made // Make sure only one manifest request is made
assert.deepEqual(actual, [{ type: 'GET', url: `${target.url}/v1/manifest`, headers: {} }]); assert.deepStrictEqual(actual, [{ type: 'GET', url: `${target.url}/v1/manifest`, headers: {} }]);
}); });
test('test first auto sync requests', async () => { test('test first auto sync requests', async () => {
@ -133,7 +133,7 @@ suite('UserDataAutoSyncService', () => {
await testObject.sync(); await testObject.sync();
assert.deepEqual(target.requests, [ assert.deepStrictEqual(target.requests, [
// Manifest // Manifest
{ type: 'GET', url: `${target.url}/v1/manifest`, headers: {} }, { type: 'GET', url: `${target.url}/v1/manifest`, headers: {} },
// Machines // Machines
@ -173,7 +173,7 @@ suite('UserDataAutoSyncService', () => {
await testObject.sync(); await testObject.sync();
assert.deepEqual(target.requests, [ assert.deepStrictEqual(target.requests, [
// Manifest // Manifest
{ type: 'GET', url: `${target.url}/v1/manifest`, headers: {} } { type: 'GET', url: `${target.url}/v1/manifest`, headers: {} }
]); ]);
@ -200,7 +200,7 @@ suite('UserDataAutoSyncService', () => {
await fileService.writeFile(environmentService.argvResource, VSBuffer.fromString(JSON.stringify({ 'locale': 'de' }))); await fileService.writeFile(environmentService.argvResource, VSBuffer.fromString(JSON.stringify({ 'locale': 'de' })));
await testObject.sync(); await testObject.sync();
assert.deepEqual(target.requests, [ assert.deepStrictEqual(target.requests, [
// Manifest // Manifest
{ type: 'GET', url: `${target.url}/v1/manifest`, headers: {} }, { type: 'GET', url: `${target.url}/v1/manifest`, headers: {} },
// Settings // Settings
@ -264,8 +264,8 @@ suite('UserDataAutoSyncService', () => {
const e = await errorPromise; const e = await errorPromise;
assert.ok(e instanceof UserDataAutoSyncError); assert.ok(e instanceof UserDataAutoSyncError);
assert.deepEqual((<UserDataAutoSyncError>e).code, UserDataSyncErrorCode.TurnedOff); assert.deepStrictEqual((<UserDataAutoSyncError>e).code, UserDataSyncErrorCode.TurnedOff);
assert.deepEqual(target.requests, [ assert.deepStrictEqual(target.requests, [
// Manifest // Manifest
{ type: 'GET', url: `${target.url}/v1/manifest`, headers: {} }, { type: 'GET', url: `${target.url}/v1/manifest`, headers: {} },
// Machine // Machine
@ -295,8 +295,8 @@ suite('UserDataAutoSyncService', () => {
const e = await errorPromise; const e = await errorPromise;
assert.ok(e instanceof UserDataAutoSyncError); assert.ok(e instanceof UserDataAutoSyncError);
assert.deepEqual((<UserDataAutoSyncError>e).code, UserDataSyncErrorCode.TurnedOff); assert.deepStrictEqual((<UserDataAutoSyncError>e).code, UserDataSyncErrorCode.TurnedOff);
assert.deepEqual(target.requests, [ assert.deepStrictEqual(target.requests, [
// Manifest // Manifest
{ type: 'GET', url: `${target.url}/v1/manifest`, headers: {} }, { type: 'GET', url: `${target.url}/v1/manifest`, headers: {} },
// Machine // Machine
@ -320,7 +320,7 @@ suite('UserDataAutoSyncService', () => {
target.reset(); target.reset();
await testObject.sync(); await testObject.sync();
assert.deepEqual(target.requests, [ assert.deepStrictEqual(target.requests, [
// Manifest // Manifest
{ type: 'GET', url: `${target.url}/v1/manifest`, headers: {} }, { type: 'GET', url: `${target.url}/v1/manifest`, headers: {} },
// Machine // Machine
@ -356,8 +356,8 @@ suite('UserDataAutoSyncService', () => {
const e = await errorPromise; const e = await errorPromise;
assert.ok(e instanceof UserDataAutoSyncError); assert.ok(e instanceof UserDataAutoSyncError);
assert.deepEqual((<UserDataAutoSyncError>e).code, UserDataSyncErrorCode.SessionExpired); assert.deepStrictEqual((<UserDataAutoSyncError>e).code, UserDataSyncErrorCode.SessionExpired);
assert.deepEqual(target.requests, [ assert.deepStrictEqual(target.requests, [
// Manifest // Manifest
{ type: 'GET', url: `${target.url}/v1/manifest`, headers: {} }, { type: 'GET', url: `${target.url}/v1/manifest`, headers: {} },
// Machine // Machine
@ -380,7 +380,7 @@ suite('UserDataAutoSyncService', () => {
const e = await errorPromise; const e = await errorPromise;
assert.ok(e instanceof UserDataSyncStoreError); assert.ok(e instanceof UserDataSyncStoreError);
assert.deepEqual((<UserDataSyncStoreError>e).code, UserDataSyncErrorCode.TooManyRequests); assert.deepStrictEqual((<UserDataSyncStoreError>e).code, UserDataSyncErrorCode.TooManyRequests);
}); });
test('test auto sync is suspended when server donot accepts requests', async () => { test('test auto sync is suspended when server donot accepts requests', async () => {
@ -398,7 +398,7 @@ suite('UserDataAutoSyncService', () => {
target.reset(); target.reset();
await testObject.sync(); await testObject.sync();
assert.deepEqual(target.requests, []); assert.deepStrictEqual(target.requests, []);
}); });
test('test cache control header with no cache is sent when triggered with disable cache option', async () => { test('test cache control header with no cache is sent when triggered with disable cache option', async () => {

View file

@ -28,7 +28,7 @@ suite('UserDataSyncService', () => {
// Sync for first time // Sync for first time
await (await testObject.createSyncTask()).run(); await (await testObject.createSyncTask()).run();
assert.deepEqual(target.requests, [ assert.deepStrictEqual(target.requests, [
// Manifest // Manifest
{ type: 'GET', url: `${target.url}/v1/manifest`, headers: {} }, { type: 'GET', url: `${target.url}/v1/manifest`, headers: {} },
// Settings // Settings
@ -59,7 +59,7 @@ suite('UserDataSyncService', () => {
// Sync for first time // Sync for first time
await (await testObject.createSyncTask()).run(); await (await testObject.createSyncTask()).run();
assert.deepEqual(target.requests, [ assert.deepStrictEqual(target.requests, [
// Manifest // Manifest
{ type: 'GET', url: `${target.url}/v1/manifest`, headers: {} }, { type: 'GET', url: `${target.url}/v1/manifest`, headers: {} },
// Settings // Settings
@ -93,7 +93,7 @@ suite('UserDataSyncService', () => {
target.reset(); target.reset();
await (await testObject.createSyncTask()).run(); await (await testObject.createSyncTask()).run();
assert.deepEqual(target.requests, [ assert.deepStrictEqual(target.requests, [
{ type: 'GET', url: `${target.url}/v1/manifest`, headers: {} }, { type: 'GET', url: `${target.url}/v1/manifest`, headers: {} },
{ type: 'GET', url: `${target.url}/v1/resource/settings/latest`, headers: {} }, { type: 'GET', url: `${target.url}/v1/resource/settings/latest`, headers: {} },
{ type: 'GET', url: `${target.url}/v1/resource/keybindings/latest`, headers: {} }, { type: 'GET', url: `${target.url}/v1/resource/keybindings/latest`, headers: {} },
@ -127,7 +127,7 @@ suite('UserDataSyncService', () => {
target.reset(); target.reset();
await (await testObject.createSyncTask()).run(); await (await testObject.createSyncTask()).run();
assert.deepEqual(target.requests, [ assert.deepStrictEqual(target.requests, [
{ type: 'GET', url: `${target.url}/v1/manifest`, headers: {} }, { type: 'GET', url: `${target.url}/v1/manifest`, headers: {} },
{ type: 'GET', url: `${target.url}/v1/resource/settings/latest`, headers: {} }, { type: 'GET', url: `${target.url}/v1/resource/settings/latest`, headers: {} },
{ type: 'POST', url: `${target.url}/v1/resource/settings`, headers: { 'If-Match': '1' } }, { type: 'POST', url: `${target.url}/v1/resource/settings`, headers: { 'If-Match': '1' } },
@ -154,7 +154,7 @@ suite('UserDataSyncService', () => {
target.reset(); target.reset();
await (await testObject.createSyncTask()).run(); await (await testObject.createSyncTask()).run();
assert.deepEqual(target.requests, [ assert.deepStrictEqual(target.requests, [
// Manifest // Manifest
{ type: 'GET', url: `${target.url}/v1/manifest`, headers: {} }, { type: 'GET', url: `${target.url}/v1/manifest`, headers: {} },
]); ]);
@ -181,7 +181,7 @@ suite('UserDataSyncService', () => {
// Sync from the client // Sync from the client
await (await testObject.createSyncTask()).run(); await (await testObject.createSyncTask()).run();
assert.deepEqual(target.requests, [ assert.deepStrictEqual(target.requests, [
// Manifest // Manifest
{ type: 'GET', url: `${target.url}/v1/manifest`, headers: {} }, { type: 'GET', url: `${target.url}/v1/manifest`, headers: {} },
// Settings // Settings
@ -222,7 +222,7 @@ suite('UserDataSyncService', () => {
target.reset(); target.reset();
await (await testObject.createSyncTask()).run(); await (await testObject.createSyncTask()).run();
assert.deepEqual(target.requests, [ assert.deepStrictEqual(target.requests, [
// Manifest // Manifest
{ type: 'GET', url: `${target.url}/v1/manifest`, headers: {} }, { type: 'GET', url: `${target.url}/v1/manifest`, headers: {} },
// Settings // Settings
@ -250,7 +250,7 @@ suite('UserDataSyncService', () => {
target.reset(); target.reset();
await testObject.reset(); await testObject.reset();
assert.deepEqual(target.requests, [ assert.deepStrictEqual(target.requests, [
// Manifest // Manifest
{ type: 'DELETE', url: `${target.url}/v1/resource`, headers: {} }, { type: 'DELETE', url: `${target.url}/v1/resource`, headers: {} },
]); ]);
@ -273,7 +273,7 @@ suite('UserDataSyncService', () => {
target.reset(); target.reset();
await (await testObject.createSyncTask()).run(); await (await testObject.createSyncTask()).run();
assert.deepEqual(target.requests, [ assert.deepStrictEqual(target.requests, [
// Manifest // Manifest
{ type: 'GET', url: `${target.url}/v1/manifest`, headers: {} }, { type: 'GET', url: `${target.url}/v1/manifest`, headers: {} },
// Settings // Settings
@ -308,7 +308,7 @@ suite('UserDataSyncService', () => {
await (await testObject.createSyncTask()).run(); await (await testObject.createSyncTask()).run();
disposable.dispose(); disposable.dispose();
assert.deepEqual(actualStatuses, [SyncStatus.Syncing, SyncStatus.Idle, SyncStatus.Syncing, SyncStatus.Idle, SyncStatus.Syncing, SyncStatus.Idle, SyncStatus.Syncing, SyncStatus.Idle, SyncStatus.Syncing, SyncStatus.Idle]); assert.deepStrictEqual(actualStatuses, [SyncStatus.Syncing, SyncStatus.Idle, SyncStatus.Syncing, SyncStatus.Idle, SyncStatus.Syncing, SyncStatus.Idle, SyncStatus.Syncing, SyncStatus.Idle, SyncStatus.Syncing, SyncStatus.Idle]);
}); });
test('test sync conflicts status', async () => { test('test sync conflicts status', async () => {
@ -333,8 +333,8 @@ suite('UserDataSyncService', () => {
// sync from the client // sync from the client
await (await testObject.createSyncTask()).run(); await (await testObject.createSyncTask()).run();
assert.deepEqual(testObject.status, SyncStatus.HasConflicts); assert.deepStrictEqual(testObject.status, SyncStatus.HasConflicts);
assert.deepEqual(testObject.conflicts.map(([syncResource]) => syncResource), [SyncResource.Settings]); assert.deepStrictEqual(testObject.conflicts.map(([syncResource]) => syncResource), [SyncResource.Settings]);
}); });
test('test sync will sync other non conflicted areas', async () => { test('test sync will sync other non conflicted areas', async () => {
@ -368,10 +368,10 @@ suite('UserDataSyncService', () => {
await (await testObject.createSyncTask()).run(); await (await testObject.createSyncTask()).run();
disposable.dispose(); disposable.dispose();
assert.deepEqual(actualStatuses, []); assert.deepStrictEqual(actualStatuses, []);
assert.deepEqual(testObject.status, SyncStatus.HasConflicts); assert.deepStrictEqual(testObject.status, SyncStatus.HasConflicts);
assert.deepEqual(target.requests, [ assert.deepStrictEqual(target.requests, [
// Manifest // Manifest
{ type: 'GET', url: `${target.url}/v1/manifest`, headers: {} }, { type: 'GET', url: `${target.url}/v1/manifest`, headers: {} },
// Keybindings // Keybindings
@ -403,8 +403,8 @@ suite('UserDataSyncService', () => {
syncTask.run().then(null, () => null /* ignore error */); syncTask.run().then(null, () => null /* ignore error */);
await syncTask.stop(); await syncTask.stop();
assert.deepEqual(testObject.status, SyncStatus.Idle); assert.deepStrictEqual(testObject.status, SyncStatus.Idle);
assert.deepEqual(testObject.conflicts, []); assert.deepStrictEqual(testObject.conflicts, []);
}); });
test('test sync send execution id header', async () => { test('test sync send execution id header', async () => {

View file

@ -63,7 +63,7 @@ suite('UserDataSyncStoreManagementService', () => {
assert.strictEqual(testObject.userDataSyncStore?.url.toString(), expected.url.toString()); assert.strictEqual(testObject.userDataSyncStore?.url.toString(), expected.url.toString());
assert.strictEqual(testObject.userDataSyncStore?.defaultUrl.toString(), expected.defaultUrl.toString()); assert.strictEqual(testObject.userDataSyncStore?.defaultUrl.toString(), expected.defaultUrl.toString());
assert.deepEqual(testObject.userDataSyncStore?.authenticationProviders, expected.authenticationProviders); assert.deepStrictEqual(testObject.userDataSyncStore?.authenticationProviders, expected.authenticationProviders);
}); });
}); });
@ -388,7 +388,7 @@ suite('UserDataSyncStoreService', () => {
assert.fail('should fail'); assert.fail('should fail');
} catch (e) { } catch (e) {
assert.ok(e instanceof UserDataSyncStoreError); assert.ok(e instanceof UserDataSyncStoreError);
assert.deepEqual((<UserDataSyncStoreError>e).code, UserDataSyncErrorCode.TooManyRequestsAndRetryAfter); assert.deepStrictEqual((<UserDataSyncStoreError>e).code, UserDataSyncErrorCode.TooManyRequestsAndRetryAfter);
await promise; await promise;
assert.ok(!!testObject.donotMakeRequestsUntil); assert.ok(!!testObject.donotMakeRequestsUntil);
} }

View file

@ -444,7 +444,7 @@ suite('Experiment Service', () => {
let rec = getCurrentActivationRecord(); let rec = getCurrentActivationRecord();
// good default: // good default:
assert.deepEqual(rec, { assert.deepStrictEqual(rec, {
count: [0, 0, 0, 0, 0, 0, 0], count: [0, 0, 0, 0, 0, 0, 0],
mostRecentBucket: Date.now(), mostRecentBucket: Date.now(),
}); });
@ -454,7 +454,7 @@ suite('Experiment Service', () => {
rec = getCurrentActivationRecord(rec); rec = getCurrentActivationRecord(rec);
// does not advance unnecessarily // does not advance unnecessarily
assert.deepEqual(getCurrentActivationRecord(rec), { assert.deepStrictEqual(getCurrentActivationRecord(rec), {
count: [1, 0, 0, 0, 0, 0, 0], count: [1, 0, 0, 0, 0, 0, 0],
mostRecentBucket: Date.now() - 1, mostRecentBucket: Date.now() - 1,
}); });
@ -462,7 +462,7 @@ suite('Experiment Service', () => {
// advances time // advances time
timers.tick(oneDay * 3); timers.tick(oneDay * 3);
rec = getCurrentActivationRecord(rec); rec = getCurrentActivationRecord(rec);
assert.deepEqual(getCurrentActivationRecord(rec), { assert.deepStrictEqual(getCurrentActivationRecord(rec), {
count: [0, 0, 0, 1, 0, 0, 0], count: [0, 0, 0, 1, 0, 0, 0],
mostRecentBucket: Date.now() - 1, mostRecentBucket: Date.now() - 1,
}); });
@ -471,7 +471,7 @@ suite('Experiment Service', () => {
timers.tick(oneDay * 4); timers.tick(oneDay * 4);
rec.count[0] = 2; rec.count[0] = 2;
rec = getCurrentActivationRecord(rec); rec = getCurrentActivationRecord(rec);
assert.deepEqual(getCurrentActivationRecord(rec), { assert.deepStrictEqual(getCurrentActivationRecord(rec), {
count: [0, 0, 0, 0, 2, 0, 0], count: [0, 0, 0, 0, 2, 0, 0],
mostRecentBucket: Date.now() - 1, mostRecentBucket: Date.now() - 1,
}); });
@ -504,7 +504,7 @@ suite('Experiment Service', () => {
if (key.includes('experimentEventRecord')) { if (key.includes('experimentEventRecord')) {
didGetCall = true; didGetCall = true;
assert.strictEqual(key, 'experimentEventRecord-my-event'); assert.strictEqual(key, 'experimentEventRecord-my-event');
assert.deepEqual(JSON.parse(value).count, [1, 0, 10, 0, 0, 0, 0]); assert.deepStrictEqual(JSON.parse(value).count, [1, 0, 10, 0, 0, 0, 0]);
assert.strictEqual(scope, StorageScope.GLOBAL); assert.strictEqual(scope, StorageScope.GLOBAL);
} }
}); });

View file

@ -263,7 +263,7 @@ suite('Files - View Model', function () {
(<any>merge2)._isDirectoryResolved = true; (<any>merge2)._isDirectoryResolved = true;
ExplorerItem.mergeLocalWithDisk(merge2, merge1); ExplorerItem.mergeLocalWithDisk(merge2, merge1);
assert.strictEqual(merge1.getChild('foo.html')!.name, 'foo.html'); assert.strictEqual(merge1.getChild('foo.html')!.name, 'foo.html');
assert.deepEqual(merge1.getChild('foo.html')!.parent, merge1, 'Check parent'); assert.deepStrictEqual(merge1.getChild('foo.html')!.parent, merge1, 'Check parent');
// Verify that merge does not replace existing children, but updates properties in that case // Verify that merge does not replace existing children, but updates properties in that case
const existingChild = merge1.getChild('foo.html'); const existingChild = merge1.getChild('foo.html');

View file

@ -182,8 +182,8 @@ suite('MarkersModel Test', () => {
assert.strictEqual(model.total, 3); assert.strictEqual(model.total, 3);
const markers = model.getResourceMarkers(document)?.markers; const markers = model.getResourceMarkers(document)?.markers;
assert.deepEqual(markers?.map(m => m.marker.severity), [MarkerSeverity.Error, MarkerSeverity.Error, MarkerSeverity.Warning]); assert.deepStrictEqual(markers?.map(m => m.marker.severity), [MarkerSeverity.Error, MarkerSeverity.Error, MarkerSeverity.Warning]);
assert.deepEqual(markers?.map(m => m.marker.resource.toString()), [frag1.toString(), frag2.toString(), frag1.toString()]); assert.deepStrictEqual(markers?.map(m => m.marker.resource.toString()), [frag1.toString(), frag2.toString(), frag1.toString()]);
}); });
function compareResource(a: ResourceMarkers, b: string): boolean { function compareResource(a: ResourceMarkers, b: string): boolean {

View file

@ -89,7 +89,7 @@ suite('Notebook Folding', () => {
foldingModel.attachViewModel(viewModel); foldingModel.attachViewModel(viewModel);
updateFoldingStateAtIndex(foldingModel, 0, true); updateFoldingStateAtIndex(foldingModel, 0, true);
viewModel.updateFoldingRanges(foldingModel.regions); viewModel.updateFoldingRanges(foldingModel.regions);
assert.deepEqual(viewModel.getHiddenRanges(), [ assert.deepStrictEqual(viewModel.getHiddenRanges(), [
{ start: 1, end: 6 } { start: 1, end: 6 }
]); ]);
} }
@ -112,7 +112,7 @@ suite('Notebook Folding', () => {
updateFoldingStateAtIndex(foldingModel, 2, true); updateFoldingStateAtIndex(foldingModel, 2, true);
viewModel.updateFoldingRanges(foldingModel.regions); viewModel.updateFoldingRanges(foldingModel.regions);
assert.deepEqual(viewModel.getHiddenRanges(), [ assert.deepStrictEqual(viewModel.getHiddenRanges(), [
{ start: 3, end: 4 } { start: 3, end: 4 }
]); ]);
} }
@ -135,7 +135,7 @@ suite('Notebook Folding', () => {
updateFoldingStateAtIndex(foldingModel, 2, true); updateFoldingStateAtIndex(foldingModel, 2, true);
viewModel.updateFoldingRanges(foldingModel.regions); viewModel.updateFoldingRanges(foldingModel.regions);
assert.deepEqual(viewModel.getHiddenRanges(), [ assert.deepStrictEqual(viewModel.getHiddenRanges(), [
{ start: 3, end: 6 } { start: 3, end: 6 }
]); ]);
} }
@ -160,7 +160,7 @@ suite('Notebook Folding', () => {
updateFoldingStateAtIndex(foldingModel, 0, true); updateFoldingStateAtIndex(foldingModel, 0, true);
viewModel.updateFoldingRanges(foldingModel.regions); viewModel.updateFoldingRanges(foldingModel.regions);
assert.deepEqual(viewModel.getHiddenRanges(), [ assert.deepStrictEqual(viewModel.getHiddenRanges(), [
{ start: 1, end: 1 } { start: 1, end: 1 }
]); ]);
@ -168,27 +168,27 @@ suite('Notebook Folding', () => {
updateFoldingStateAtIndex(foldingModel, 2, true); updateFoldingStateAtIndex(foldingModel, 2, true);
viewModel.updateFoldingRanges(foldingModel.regions); viewModel.updateFoldingRanges(foldingModel.regions);
assert.deepEqual(viewModel.getHiddenRanges(), [ assert.deepStrictEqual(viewModel.getHiddenRanges(), [
{ start: 1, end: 1 }, { start: 1, end: 1 },
{ start: 3, end: 6 } { start: 3, end: 6 }
]); ]);
updateFoldingStateAtIndex(foldingModel, 2, false); updateFoldingStateAtIndex(foldingModel, 2, false);
viewModel.updateFoldingRanges(foldingModel.regions); viewModel.updateFoldingRanges(foldingModel.regions);
assert.deepEqual(viewModel.getHiddenRanges(), [ assert.deepStrictEqual(viewModel.getHiddenRanges(), [
{ start: 1, end: 1 }, { start: 1, end: 1 },
{ start: 6, end: 6 } { start: 6, end: 6 }
]); ]);
// viewModel.insertCell(7, new TestCell(viewModel.viewType, 7, ['var c = 8;'], 'markdown', CellKind.Code, []), true); // viewModel.insertCell(7, new TestCell(viewModel.viewType, 7, ['var c = 8;'], 'markdown', CellKind.Code, []), true);
// assert.deepEqual(viewModel.getHiddenRanges(), [ // assert.deepStrictEqual(viewModel.getHiddenRanges(), [
// { start: 1, end: 1 }, // { start: 1, end: 1 },
// { start: 6, end: 7 } // { start: 6, end: 7 }
// ]); // ]);
// viewModel.insertCell(1, new TestCell(viewModel.viewType, 8, ['var c = 9;'], 'markdown', CellKind.Code, []), true); // viewModel.insertCell(1, new TestCell(viewModel.viewType, 8, ['var c = 9;'], 'markdown', CellKind.Code, []), true);
// assert.deepEqual(viewModel.getHiddenRanges(), [ // assert.deepStrictEqual(viewModel.getHiddenRanges(), [
// // the first collapsed range is now expanded as we insert content into it. // // the first collapsed range is now expanded as we insert content into it.
// // { start: 1,}, // // { start: 1,},
// { start: 7, end: 8 } // { start: 7, end: 8 }
@ -221,7 +221,7 @@ suite('Notebook Folding', () => {
viewModel.updateFoldingRanges(foldingModel.regions); viewModel.updateFoldingRanges(foldingModel.regions);
// Note that hidden ranges !== folding ranges // Note that hidden ranges !== folding ranges
assert.deepEqual(viewModel.getHiddenRanges(), [ assert.deepStrictEqual(viewModel.getHiddenRanges(), [
{ start: 3, end: 6 } { start: 3, end: 6 }
]); ]);
} }
@ -253,7 +253,7 @@ suite('Notebook Folding', () => {
viewModel.updateFoldingRanges(foldingModel.regions); viewModel.updateFoldingRanges(foldingModel.regions);
// Note that hidden ranges !== folding ranges // Note that hidden ranges !== folding ranges
assert.deepEqual(viewModel.getHiddenRanges(), [ assert.deepStrictEqual(viewModel.getHiddenRanges(), [
{ start: 6, end: 6 }, { start: 6, end: 6 },
{ start: 11, end: 11 } { start: 11, end: 11 }
]); ]);
@ -286,7 +286,7 @@ suite('Notebook Folding', () => {
viewModel.updateFoldingRanges(foldingModel.regions); viewModel.updateFoldingRanges(foldingModel.regions);
// Note that hidden ranges !== folding ranges // Note that hidden ranges !== folding ranges
assert.deepEqual(viewModel.getHiddenRanges(), [ assert.deepStrictEqual(viewModel.getHiddenRanges(), [
{ start: 6, end: 6 }, { start: 6, end: 6 },
{ start: 8, end: 11 } { start: 8, end: 11 }
]); ]);
@ -318,7 +318,7 @@ suite('Notebook Folding', () => {
viewModel.updateFoldingRanges(foldingModel.regions); viewModel.updateFoldingRanges(foldingModel.regions);
// Note that hidden ranges !== folding ranges // Note that hidden ranges !== folding ranges
assert.deepEqual(viewModel.getHiddenRanges(), [ assert.deepStrictEqual(viewModel.getHiddenRanges(), [
{ start: 3, end: 6 } { start: 3, end: 6 }
]); ]);
@ -359,7 +359,7 @@ suite('Notebook Folding', () => {
viewModel.updateFoldingRanges(foldingModel.regions); viewModel.updateFoldingRanges(foldingModel.regions);
// Note that hidden ranges !== folding ranges // Note that hidden ranges !== folding ranges
assert.deepEqual(viewModel.getHiddenRanges(), [ assert.deepStrictEqual(viewModel.getHiddenRanges(), [
{ start: 6, end: 6 }, { start: 6, end: 6 },
{ start: 11, end: 11 } { start: 11, end: 11 }
]); ]);

View file

@ -329,7 +329,7 @@ suite('NotebookTextModel', () => {
assert.notStrictEqual(changeEvent, undefined); assert.notStrictEqual(changeEvent, undefined);
assert.strictEqual(changeEvent!.rawEvents.length, 2); assert.strictEqual(changeEvent!.rawEvents.length, 2);
assert.deepEqual(changeEvent!.endSelectionState?.selections, [{ start: 0, end: 1 }]); assert.deepStrictEqual(changeEvent!.endSelectionState?.selections, [{ start: 0, end: 1 }]);
assert.strictEqual(textModel.versionId, version + 1); assert.strictEqual(textModel.versionId, version + 1);
eventListener.dispose(); eventListener.dispose();
} }
@ -363,7 +363,7 @@ suite('NotebookTextModel', () => {
assert.notStrictEqual(changeEvent, undefined); assert.notStrictEqual(changeEvent, undefined);
assert.strictEqual(changeEvent!.rawEvents.length, 2); assert.strictEqual(changeEvent!.rawEvents.length, 2);
assert.deepEqual(changeEvent!.endSelectionState?.selections, [{ start: 0, end: 1 }]); assert.deepStrictEqual(changeEvent!.endSelectionState?.selections, [{ start: 0, end: 1 }]);
assert.strictEqual(textModel.versionId, version + 1); assert.strictEqual(textModel.versionId, version + 1);
eventListener.dispose(); eventListener.dispose();
} }

View file

@ -148,61 +148,61 @@ suite('NotebookViewModel', () => {
const defaults = { hasExecutionOrder: true }; const defaults = { hasExecutionOrder: true };
assert.deepEqual(viewModel.viewCells[0].getEvaluatedMetadata(viewModel.metadata), <NotebookCellMetadata>{ assert.deepStrictEqual(viewModel.viewCells[0].getEvaluatedMetadata(viewModel.metadata), <NotebookCellMetadata>{
editable: true, editable: true,
...defaults ...defaults
}); });
assert.deepEqual(viewModel.viewCells[1].getEvaluatedMetadata(viewModel.metadata), <NotebookCellMetadata>{ assert.deepStrictEqual(viewModel.viewCells[1].getEvaluatedMetadata(viewModel.metadata), <NotebookCellMetadata>{
editable: true, editable: true,
...defaults ...defaults
}); });
assert.deepEqual(viewModel.viewCells[2].getEvaluatedMetadata(viewModel.metadata), <NotebookCellMetadata>{ assert.deepStrictEqual(viewModel.viewCells[2].getEvaluatedMetadata(viewModel.metadata), <NotebookCellMetadata>{
editable: true, editable: true,
...defaults ...defaults
}); });
assert.deepEqual(viewModel.viewCells[3].getEvaluatedMetadata(viewModel.metadata), <NotebookCellMetadata>{ assert.deepStrictEqual(viewModel.viewCells[3].getEvaluatedMetadata(viewModel.metadata), <NotebookCellMetadata>{
editable: false, editable: false,
...defaults ...defaults
}); });
assert.deepEqual(viewModel.viewCells[4].getEvaluatedMetadata(viewModel.metadata), <NotebookCellMetadata>{ assert.deepStrictEqual(viewModel.viewCells[4].getEvaluatedMetadata(viewModel.metadata), <NotebookCellMetadata>{
editable: false, editable: false,
...defaults ...defaults
}); });
viewModel.notebookDocument.metadata = { editable: true, cellEditable: true, cellHasExecutionOrder: true, trusted: true }; viewModel.notebookDocument.metadata = { editable: true, cellEditable: true, cellHasExecutionOrder: true, trusted: true };
assert.deepEqual(viewModel.viewCells[0].getEvaluatedMetadata(viewModel.metadata), <NotebookCellMetadata>{ assert.deepStrictEqual(viewModel.viewCells[0].getEvaluatedMetadata(viewModel.metadata), <NotebookCellMetadata>{
editable: true, editable: true,
...defaults ...defaults
}); });
assert.deepEqual(viewModel.viewCells[1].getEvaluatedMetadata(viewModel.metadata), <NotebookCellMetadata>{ assert.deepStrictEqual(viewModel.viewCells[1].getEvaluatedMetadata(viewModel.metadata), <NotebookCellMetadata>{
editable: true, editable: true,
...defaults ...defaults
}); });
assert.deepEqual(viewModel.viewCells[2].getEvaluatedMetadata(viewModel.metadata), <NotebookCellMetadata>{ assert.deepStrictEqual(viewModel.viewCells[2].getEvaluatedMetadata(viewModel.metadata), <NotebookCellMetadata>{
editable: true, editable: true,
...defaults ...defaults
}); });
assert.deepEqual(viewModel.viewCells[3].getEvaluatedMetadata(viewModel.metadata), <NotebookCellMetadata>{ assert.deepStrictEqual(viewModel.viewCells[3].getEvaluatedMetadata(viewModel.metadata), <NotebookCellMetadata>{
editable: false, editable: false,
...defaults ...defaults
}); });
assert.deepEqual(viewModel.viewCells[4].getEvaluatedMetadata(viewModel.metadata), <NotebookCellMetadata>{ assert.deepStrictEqual(viewModel.viewCells[4].getEvaluatedMetadata(viewModel.metadata), <NotebookCellMetadata>{
editable: false, editable: false,
...defaults ...defaults
}); });
viewModel.notebookDocument.metadata = { editable: true, cellEditable: false, cellHasExecutionOrder: true, trusted: true }; viewModel.notebookDocument.metadata = { editable: true, cellEditable: false, cellHasExecutionOrder: true, trusted: true };
assert.deepEqual(viewModel.viewCells[0].getEvaluatedMetadata(viewModel.metadata), <NotebookCellMetadata>{ assert.deepStrictEqual(viewModel.viewCells[0].getEvaluatedMetadata(viewModel.metadata), <NotebookCellMetadata>{
editable: false, editable: false,
...defaults ...defaults
}); });
@ -249,42 +249,42 @@ suite('NotebookViewModel Decorations', () => {
(editor) => { (editor) => {
const viewModel = editor.viewModel; const viewModel = editor.viewModel;
const trackedId = viewModel.setTrackedRange('test', { start: 1, end: 2 }, TrackedRangeStickiness.GrowsOnlyWhenTypingAfter); const trackedId = viewModel.setTrackedRange('test', { start: 1, end: 2 }, TrackedRangeStickiness.GrowsOnlyWhenTypingAfter);
assert.deepEqual(viewModel.getTrackedRange(trackedId!), { assert.deepStrictEqual(viewModel.getTrackedRange(trackedId!), {
start: 1, start: 1,
end: 2, end: 2,
}); });
viewModel.createCell(0, 'var d = 6;', 'javascript', CellKind.Code, {}, [], true); viewModel.createCell(0, 'var d = 6;', 'javascript', CellKind.Code, {}, [], true);
assert.deepEqual(viewModel.getTrackedRange(trackedId!), { assert.deepStrictEqual(viewModel.getTrackedRange(trackedId!), {
start: 2, start: 2,
end: 3 end: 3
}); });
viewModel.deleteCell(0, true); viewModel.deleteCell(0, true);
assert.deepEqual(viewModel.getTrackedRange(trackedId!), { assert.deepStrictEqual(viewModel.getTrackedRange(trackedId!), {
start: 1, start: 1,
end: 2 end: 2
}); });
viewModel.createCell(3, 'var d = 7;', 'javascript', CellKind.Code, {}, [], true); viewModel.createCell(3, 'var d = 7;', 'javascript', CellKind.Code, {}, [], true);
assert.deepEqual(viewModel.getTrackedRange(trackedId!), { assert.deepStrictEqual(viewModel.getTrackedRange(trackedId!), {
start: 1, start: 1,
end: 3 end: 3
}); });
viewModel.deleteCell(3, true); viewModel.deleteCell(3, true);
assert.deepEqual(viewModel.getTrackedRange(trackedId!), { assert.deepStrictEqual(viewModel.getTrackedRange(trackedId!), {
start: 1, start: 1,
end: 2 end: 2
}); });
viewModel.deleteCell(1, true); viewModel.deleteCell(1, true);
assert.deepEqual(viewModel.getTrackedRange(trackedId!), { assert.deepStrictEqual(viewModel.getTrackedRange(trackedId!), {
start: 0, start: 0,
end: 1 end: 1
@ -307,21 +307,21 @@ suite('NotebookViewModel Decorations', () => {
(editor) => { (editor) => {
const viewModel = editor.viewModel; const viewModel = editor.viewModel;
const trackedId = viewModel.setTrackedRange('test', { start: 1, end: 3 }, TrackedRangeStickiness.GrowsOnlyWhenTypingAfter); const trackedId = viewModel.setTrackedRange('test', { start: 1, end: 3 }, TrackedRangeStickiness.GrowsOnlyWhenTypingAfter);
assert.deepEqual(viewModel.getTrackedRange(trackedId!), { assert.deepStrictEqual(viewModel.getTrackedRange(trackedId!), {
start: 1, start: 1,
end: 3 end: 3
}); });
viewModel.createCell(5, 'var d = 9;', 'javascript', CellKind.Code, {}, [], true); viewModel.createCell(5, 'var d = 9;', 'javascript', CellKind.Code, {}, [], true);
assert.deepEqual(viewModel.getTrackedRange(trackedId!), { assert.deepStrictEqual(viewModel.getTrackedRange(trackedId!), {
start: 1, start: 1,
end: 3 end: 3
}); });
viewModel.createCell(4, 'var d = 10;', 'javascript', CellKind.Code, {}, [], true); viewModel.createCell(4, 'var d = 10;', 'javascript', CellKind.Code, {}, [], true);
assert.deepEqual(viewModel.getTrackedRange(trackedId!), { assert.deepStrictEqual(viewModel.getTrackedRange(trackedId!), {
start: 1, start: 1,
end: 4 end: 4
@ -331,7 +331,7 @@ suite('NotebookViewModel Decorations', () => {
}); });
test('reduce range', async function () { test('reduce range', async function () {
assert.deepEqual(reduceCellRanges([ assert.deepStrictEqual(reduceCellRanges([
{ start: 0, end: 1 }, { start: 0, end: 1 },
{ start: 1, end: 2 }, { start: 1, end: 2 },
{ start: 4, end: 6 } { start: 4, end: 6 }
@ -340,7 +340,7 @@ suite('NotebookViewModel Decorations', () => {
{ start: 4, end: 6 } { start: 4, end: 6 }
]); ]);
assert.deepEqual(reduceCellRanges([ assert.deepStrictEqual(reduceCellRanges([
{ start: 0, end: 1 }, { start: 0, end: 1 },
{ start: 1, end: 2 }, { start: 1, end: 2 },
{ start: 3, end: 4 } { start: 3, end: 4 }
@ -350,9 +350,9 @@ suite('NotebookViewModel Decorations', () => {
}); });
test('diff hidden ranges', async function () { test('diff hidden ranges', async function () {
assert.deepEqual(getVisibleCells<number>([1, 2, 3, 4, 5], []), [1, 2, 3, 4, 5]); assert.deepStrictEqual(getVisibleCells<number>([1, 2, 3, 4, 5], []), [1, 2, 3, 4, 5]);
assert.deepEqual( assert.deepStrictEqual(
getVisibleCells<number>( getVisibleCells<number>(
[1, 2, 3, 4, 5], [1, 2, 3, 4, 5],
[{ start: 1, end: 2 }] [{ start: 1, end: 2 }]
@ -360,7 +360,7 @@ suite('NotebookViewModel Decorations', () => {
[1, 4, 5] [1, 4, 5]
); );
assert.deepEqual( assert.deepStrictEqual(
getVisibleCells<number>( getVisibleCells<number>(
[1, 2, 3, 4, 5, 6, 7, 8, 9], [1, 2, 3, 4, 5, 6, 7, 8, 9],
[ [
@ -386,7 +386,7 @@ suite('NotebookViewModel Decorations', () => {
] ]
); );
assert.deepEqual(diff<number>(original, modified, (a) => { assert.deepStrictEqual(diff<number>(original, modified, (a) => {
return original.indexOf(a) >= 0; return original.indexOf(a) >= 0;
}), [{ start: 1, deleteCount: 1, toInsert: [2, 6] }]); }), [{ start: 1, deleteCount: 1, toInsert: [2, 6] }]);
}); });

View file

@ -8,42 +8,42 @@ import { settingKeyToDisplayFormat, parseQuery, IParsedQuery } from 'vs/workbenc
suite('SettingsTree', () => { suite('SettingsTree', () => {
test('settingKeyToDisplayFormat', () => { test('settingKeyToDisplayFormat', () => {
assert.deepEqual( assert.deepStrictEqual(
settingKeyToDisplayFormat('foo.bar'), settingKeyToDisplayFormat('foo.bar'),
{ {
category: 'Foo', category: 'Foo',
label: 'Bar' label: 'Bar'
}); });
assert.deepEqual( assert.deepStrictEqual(
settingKeyToDisplayFormat('foo.bar.etc'), settingKeyToDisplayFormat('foo.bar.etc'),
{ {
category: 'Foo Bar', category: 'Foo Bar',
label: 'Etc' label: 'Etc'
}); });
assert.deepEqual( assert.deepStrictEqual(
settingKeyToDisplayFormat('fooBar.etcSomething'), settingKeyToDisplayFormat('fooBar.etcSomething'),
{ {
category: 'Foo Bar', category: 'Foo Bar',
label: 'Etc Something' label: 'Etc Something'
}); });
assert.deepEqual( assert.deepStrictEqual(
settingKeyToDisplayFormat('foo'), settingKeyToDisplayFormat('foo'),
{ {
category: '', category: '',
label: 'Foo' label: 'Foo'
}); });
assert.deepEqual( assert.deepStrictEqual(
settingKeyToDisplayFormat('foo.1leading.number'), settingKeyToDisplayFormat('foo.1leading.number'),
{ {
category: 'Foo 1leading', category: 'Foo 1leading',
label: 'Number' label: 'Number'
}); });
assert.deepEqual( assert.deepStrictEqual(
settingKeyToDisplayFormat('foo.1Leading.number'), settingKeyToDisplayFormat('foo.1Leading.number'),
{ {
category: 'Foo 1 Leading', category: 'Foo 1 Leading',
@ -52,56 +52,56 @@ suite('SettingsTree', () => {
}); });
test('settingKeyToDisplayFormat - with category', () => { test('settingKeyToDisplayFormat - with category', () => {
assert.deepEqual( assert.deepStrictEqual(
settingKeyToDisplayFormat('foo.bar', 'foo'), settingKeyToDisplayFormat('foo.bar', 'foo'),
{ {
category: '', category: '',
label: 'Bar' label: 'Bar'
}); });
assert.deepEqual( assert.deepStrictEqual(
settingKeyToDisplayFormat('disableligatures.ligatures', 'disableligatures'), settingKeyToDisplayFormat('disableligatures.ligatures', 'disableligatures'),
{ {
category: '', category: '',
label: 'Ligatures' label: 'Ligatures'
}); });
assert.deepEqual( assert.deepStrictEqual(
settingKeyToDisplayFormat('foo.bar.etc', 'foo'), settingKeyToDisplayFormat('foo.bar.etc', 'foo'),
{ {
category: 'Bar', category: 'Bar',
label: 'Etc' label: 'Etc'
}); });
assert.deepEqual( assert.deepStrictEqual(
settingKeyToDisplayFormat('fooBar.etcSomething', 'foo'), settingKeyToDisplayFormat('fooBar.etcSomething', 'foo'),
{ {
category: 'Foo Bar', category: 'Foo Bar',
label: 'Etc Something' label: 'Etc Something'
}); });
assert.deepEqual( assert.deepStrictEqual(
settingKeyToDisplayFormat('foo.bar.etc', 'foo/bar'), settingKeyToDisplayFormat('foo.bar.etc', 'foo/bar'),
{ {
category: '', category: '',
label: 'Etc' label: 'Etc'
}); });
assert.deepEqual( assert.deepStrictEqual(
settingKeyToDisplayFormat('foo.bar.etc', 'something/foo'), settingKeyToDisplayFormat('foo.bar.etc', 'something/foo'),
{ {
category: 'Bar', category: 'Bar',
label: 'Etc' label: 'Etc'
}); });
assert.deepEqual( assert.deepStrictEqual(
settingKeyToDisplayFormat('bar.etc', 'something.bar'), settingKeyToDisplayFormat('bar.etc', 'something.bar'),
{ {
category: '', category: '',
label: 'Etc' label: 'Etc'
}); });
assert.deepEqual( assert.deepStrictEqual(
settingKeyToDisplayFormat('fooBar.etc', 'fooBar'), settingKeyToDisplayFormat('fooBar.etc', 'fooBar'),
{ {
category: '', category: '',
@ -109,7 +109,7 @@ suite('SettingsTree', () => {
}); });
assert.deepEqual( assert.deepStrictEqual(
settingKeyToDisplayFormat('fooBar.somethingElse.etc', 'fooBar'), settingKeyToDisplayFormat('fooBar.somethingElse.etc', 'fooBar'),
{ {
category: 'Something Else', category: 'Something Else',
@ -118,14 +118,14 @@ suite('SettingsTree', () => {
}); });
test('settingKeyToDisplayFormat - known acronym/term', () => { test('settingKeyToDisplayFormat - known acronym/term', () => {
assert.deepEqual( assert.deepStrictEqual(
settingKeyToDisplayFormat('css.someCssSetting'), settingKeyToDisplayFormat('css.someCssSetting'),
{ {
category: 'CSS', category: 'CSS',
label: 'Some CSS Setting' label: 'Some CSS Setting'
}); });
assert.deepEqual( assert.deepStrictEqual(
settingKeyToDisplayFormat('powershell.somePowerShellSetting'), settingKeyToDisplayFormat('powershell.somePowerShellSetting'),
{ {
category: 'PowerShell', category: 'PowerShell',
@ -135,7 +135,7 @@ suite('SettingsTree', () => {
test('parseQuery', () => { test('parseQuery', () => {
function testParseQuery(input: string, expected: IParsedQuery) { function testParseQuery(input: string, expected: IParsedQuery) {
assert.deepEqual( assert.deepStrictEqual(
parseQuery(input), parseQuery(input),
expected, expected,
input input

View file

@ -19,7 +19,7 @@ suite('SmartSnippetInserter', () => {
prepend, prepend,
append append
}; };
assert.deepEqual(actual, expected); assert.deepStrictEqual(actual, expected);
}); });
model.dispose(); model.dispose();
} }

View file

@ -554,7 +554,7 @@ suite('QueryBuilder', () => {
suite('parseSearchPaths', () => { suite('parseSearchPaths', () => {
test('simple includes', () => { test('simple includes', () => {
function testSimpleIncludes(includePattern: string, expectedPatterns: string[]): void { function testSimpleIncludes(includePattern: string, expectedPatterns: string[]): void {
assert.deepEqual( assert.deepStrictEqual(
queryBuilder.parseSearchPaths(includePattern), queryBuilder.parseSearchPaths(includePattern),
{ {
pattern: patternsToIExpression(...expectedPatterns) pattern: patternsToIExpression(...expectedPatterns)
@ -1011,13 +1011,13 @@ export function assertEqualQueries(actual: ITextQuery | IFileQuery, expected: IT
// Avoid comparing URI objects, not a good idea // Avoid comparing URI objects, not a good idea
if (expected.folderQueries) { if (expected.folderQueries) {
assert.deepEqual(actual.folderQueries.map(folderQueryToCompareObject), expected.folderQueries.map(folderQueryToCompareObject)); assert.deepStrictEqual(actual.folderQueries.map(folderQueryToCompareObject), expected.folderQueries.map(folderQueryToCompareObject));
actual.folderQueries = []; actual.folderQueries = [];
expected.folderQueries = []; expected.folderQueries = [];
} }
if (expected.extraFileResources) { if (expected.extraFileResources) {
assert.deepEqual(actual.extraFileResources!.map(extraFile => extraFile.fsPath), expected.extraFileResources.map(extraFile => extraFile.fsPath)); assert.deepStrictEqual(actual.extraFileResources!.map(extraFile => extraFile.fsPath), expected.extraFileResources.map(extraFile => extraFile.fsPath));
delete expected.extraFileResources; delete expected.extraFileResources;
delete actual.extraFileResources; delete actual.extraFileResources;
} }
@ -1032,13 +1032,13 @@ export function assertEqualQueries(actual: ITextQuery | IFileQuery, expected: IT
export function assertEqualSearchPathResults(actual: ISearchPathsInfo, expected: ISearchPathsInfo, message?: string): void { export function assertEqualSearchPathResults(actual: ISearchPathsInfo, expected: ISearchPathsInfo, message?: string): void {
cleanUndefinedQueryValues(actual); cleanUndefinedQueryValues(actual);
assert.deepEqual(actual.pattern, expected.pattern, message); assert.deepStrictEqual(actual.pattern, expected.pattern, message);
assert.strictEqual(actual.searchPaths && actual.searchPaths.length, expected.searchPaths && expected.searchPaths.length); assert.strictEqual(actual.searchPaths && actual.searchPaths.length, expected.searchPaths && expected.searchPaths.length);
if (actual.searchPaths) { if (actual.searchPaths) {
actual.searchPaths.forEach((searchPath, i) => { actual.searchPaths.forEach((searchPath, i) => {
const expectedSearchPath = expected.searchPaths![i]; const expectedSearchPath = expected.searchPaths![i];
assert.deepEqual(searchPath.pattern, expectedSearchPath.pattern); assert.deepStrictEqual(searchPath.pattern, expectedSearchPath.pattern);
assert.strictEqual(searchPath.searchPath.toString(), expectedSearchPath.searchPath.toString()); assert.strictEqual(searchPath.searchPath.toString(), expectedSearchPath.searchPath.toString());
}); });
} }
@ -1046,7 +1046,7 @@ export function assertEqualSearchPathResults(actual: ISearchPathsInfo, expected:
/** /**
* Recursively delete all undefined property values from the search query, to make it easier to * Recursively delete all undefined property values from the search query, to make it easier to
* assert.deepEqual with some expected object. * assert.deepStrictEqual with some expected object.
*/ */
export function cleanUndefinedQueryValues(q: any): void { export function cleanUndefinedQueryValues(q: any): void {
for (const key in q) { for (const key in q) {

View file

@ -172,7 +172,7 @@ suite('SearchModel', () => {
assert.ok(target.calledThrice); assert.ok(target.calledThrice);
const data = target.args[0]; const data = target.args[0];
data[1].duration = -1; data[1].duration = -1;
assert.deepEqual(['searchResultsFirstRender', { duration: -1 }], data); assert.deepStrictEqual(['searchResultsFirstRender', { duration: -1 }], data);
}); });
test('Search Model: Search reports timed telemetry on search when progress is not called', () => { test('Search Model: Search reports timed telemetry on search when progress is not called', () => {

View file

@ -241,7 +241,7 @@ suite('SearchResult', () => {
testObject.remove(objectToRemove); testObject.remove(objectToRemove);
assert.ok(target.calledOnce); assert.ok(target.calledOnce);
assert.deepEqual([{ elements: [objectToRemove], removed: true }], target.args[0]); assert.deepStrictEqual([{ elements: [objectToRemove], removed: true }], target.args[0]);
}); });
test('remove array triggers change event', function () { test('remove array triggers change event', function () {
@ -258,7 +258,7 @@ suite('SearchResult', () => {
testObject.remove(arrayToRemove); testObject.remove(arrayToRemove);
assert.ok(target.calledOnce); assert.ok(target.calledOnce);
assert.deepEqual([{ elements: arrayToRemove, removed: true }], target.args[0]); assert.deepStrictEqual([{ elements: arrayToRemove, removed: true }], target.args[0]);
}); });
test('remove triggers change event', function () { test('remove triggers change event', function () {
@ -273,7 +273,7 @@ suite('SearchResult', () => {
testObject.remove(objectToRemove); testObject.remove(objectToRemove);
assert.ok(target.calledOnce); assert.ok(target.calledOnce);
assert.deepEqual([{ elements: [objectToRemove], removed: true }], target.args[0]); assert.deepStrictEqual([{ elements: [objectToRemove], removed: true }], target.args[0]);
}); });
test('Removing all line matches and adding back will add file back to result', function () { test('Removing all line matches and adding back will add file back to result', function () {
@ -320,7 +320,7 @@ suite('SearchResult', () => {
return voidPromise.then(() => { return voidPromise.then(() => {
assert.ok(target.calledOnce); assert.ok(target.calledOnce);
assert.deepEqual([{ elements: [objectToRemove], removed: true }], target.args[0]); assert.deepStrictEqual([{ elements: [objectToRemove], removed: true }], target.args[0]);
}); });
}); });

View file

@ -499,13 +499,13 @@ function assertCommandConfiguration(actual: Tasks.CommandConfiguration, expected
assert.strictEqual(actual.runtime, expected.runtime, 'runtime type'); assert.strictEqual(actual.runtime, expected.runtime, 'runtime type');
assert.strictEqual(actual.suppressTaskName, expected.suppressTaskName, 'suppressTaskName'); assert.strictEqual(actual.suppressTaskName, expected.suppressTaskName, 'suppressTaskName');
assert.strictEqual(actual.taskSelector, expected.taskSelector, 'taskSelector'); assert.strictEqual(actual.taskSelector, expected.taskSelector, 'taskSelector');
assert.deepEqual(actual.args, expected.args, 'args'); assert.deepStrictEqual(actual.args, expected.args, 'args');
assert.strictEqual(typeof actual.options, typeof expected.options); assert.strictEqual(typeof actual.options, typeof expected.options);
if (actual.options && expected.options) { if (actual.options && expected.options) {
assert.strictEqual(actual.options.cwd, expected.options.cwd, 'cwd'); assert.strictEqual(actual.options.cwd, expected.options.cwd, 'cwd');
assert.strictEqual(typeof actual.options.env, typeof expected.options.env, 'env'); assert.strictEqual(typeof actual.options.env, typeof expected.options.env, 'env');
if (actual.options.env && expected.options.env) { if (actual.options.env && expected.options.env) {
assert.deepEqual(actual.options.env, expected.options.env, 'env'); assert.deepStrictEqual(actual.options.env, expected.options.env, 'env');
} }
} }
} }

View file

@ -72,7 +72,7 @@ suite('ProblemPatternParser', () => {
}; };
let parsed = parser.parse(problemPattern); let parsed = parser.parse(problemPattern);
assert(reporter.isOK()); assert(reporter.isOK());
assert.deepEqual(parsed, { assert.deepStrictEqual(parsed, {
regexp: testRegexp, regexp: testRegexp,
kind: matchers.ProblemLocationKind.Location, kind: matchers.ProblemLocationKind.Location,
file: 1, file: 1,
@ -87,7 +87,7 @@ suite('ProblemPatternParser', () => {
kind: 'file' kind: 'file'
}; };
let parsed = parser.parse(problemPattern); let parsed = parser.parse(problemPattern);
assert.deepEqual(parsed, { assert.deepStrictEqual(parsed, {
regexp: testRegexp, regexp: testRegexp,
kind: matchers.ProblemLocationKind.File, kind: matchers.ProblemLocationKind.File,
file: 1, file: 1,
@ -103,7 +103,7 @@ suite('ProblemPatternParser', () => {
]; ];
let parsed = parser.parse(problemPattern); let parsed = parser.parse(problemPattern);
assert(reporter.isOK()); assert(reporter.isOK());
assert.deepEqual(parsed, assert.deepStrictEqual(parsed,
[{ [{
regexp: testRegexp, regexp: testRegexp,
kind: matchers.ProblemLocationKind.Location, kind: matchers.ProblemLocationKind.Location,
@ -120,7 +120,7 @@ suite('ProblemPatternParser', () => {
]; ];
let parsed = parser.parse(problemPattern); let parsed = parser.parse(problemPattern);
assert(reporter.isOK()); assert(reporter.isOK());
assert.deepEqual(parsed, assert.deepStrictEqual(parsed,
[{ [{
regexp: testRegexp, regexp: testRegexp,
kind: matchers.ProblemLocationKind.Location, kind: matchers.ProblemLocationKind.Location,
@ -139,7 +139,7 @@ suite('ProblemPatternParser', () => {
]; ];
let parsed = parser.parse(problemPattern); let parsed = parser.parse(problemPattern);
assert(reporter.isOK()); assert(reporter.isOK());
assert.deepEqual(parsed, [ assert.deepStrictEqual(parsed, [
{ regexp: testRegexp, kind: matchers.ProblemLocationKind.Location, file: 3 }, { regexp: testRegexp, kind: matchers.ProblemLocationKind.Location, file: 3 },
{ regexp: new RegExp('test1'), line: 4 }, { regexp: new RegExp('test1'), line: 4 },
{ regexp: new RegExp('test2'), character: 5 }, { regexp: new RegExp('test2'), character: 5 },
@ -224,7 +224,7 @@ suite('ProblemPatternParser', () => {
]; ];
let parsed = parser.parse(problemPattern); let parsed = parser.parse(problemPattern);
assert(reporter.isOK()); assert(reporter.isOK());
assert.deepEqual(parsed, assert.deepStrictEqual(parsed,
[{ [{
regexp: testRegexp, regexp: testRegexp,
kind: matchers.ProblemLocationKind.File, kind: matchers.ProblemLocationKind.File,

View file

@ -15,7 +15,7 @@ suite('Workbench - Terminal Link Helpers', () => {
{ text: '.com/f/', width: 8 } { text: '.com/f/', width: 8 }
]); ]);
const bufferRange = convertLinkRangeToBuffer(lines, 11, { startColumn: 4, startLineNumber: 1, endColumn: 19, endLineNumber: 1 }, 0); const bufferRange = convertLinkRangeToBuffer(lines, 11, { startColumn: 4, startLineNumber: 1, endColumn: 19, endLineNumber: 1 }, 0);
assert.deepEqual(bufferRange, { assert.deepStrictEqual(bufferRange, {
start: { x: 4, y: 1 }, start: { x: 4, y: 1 },
end: { x: 7, y: 2 } end: { x: 7, y: 2 }
}); });
@ -26,7 +26,7 @@ suite('Workbench - Terminal Link Helpers', () => {
{ text: 't.com/f/', width: 9 } { text: 't.com/f/', width: 9 }
]); ]);
const bufferRange = convertLinkRangeToBuffer(lines, 11, { startColumn: 4, startLineNumber: 1, endColumn: 19, endLineNumber: 1 }, 0); const bufferRange = convertLinkRangeToBuffer(lines, 11, { startColumn: 4, startLineNumber: 1, endColumn: 19, endLineNumber: 1 }, 0);
assert.deepEqual(bufferRange, { assert.deepStrictEqual(bufferRange, {
start: { x: 4 + 1, y: 1 }, start: { x: 4 + 1, y: 1 },
end: { x: 7 + 1, y: 2 } end: { x: 7 + 1, y: 2 }
}); });
@ -37,7 +37,7 @@ suite('Workbench - Terminal Link Helpers', () => {
{ text: 't.com/f/', width: 9 } { text: 't.com/f/', width: 9 }
]); ]);
const bufferRange = convertLinkRangeToBuffer(lines, 11, { startColumn: 4 + 1, startLineNumber: 1, endColumn: 19 + 1, endLineNumber: 1 }, 0); const bufferRange = convertLinkRangeToBuffer(lines, 11, { startColumn: 4 + 1, startLineNumber: 1, endColumn: 19 + 1, endLineNumber: 1 }, 0);
assert.deepEqual(bufferRange, { assert.deepStrictEqual(bufferRange, {
start: { x: 4, y: 1 }, start: { x: 4, y: 1 },
end: { x: 7, y: 2 } end: { x: 7, y: 2 }
}); });
@ -48,7 +48,7 @@ suite('Workbench - Terminal Link Helpers', () => {
{ text: '.com/文/', width: 8 } { text: '.com/文/', width: 8 }
]); ]);
const bufferRange = convertLinkRangeToBuffer(lines, 11, { startColumn: 4, startLineNumber: 1, endColumn: 19, endLineNumber: 1 }, 0); const bufferRange = convertLinkRangeToBuffer(lines, 11, { startColumn: 4, startLineNumber: 1, endColumn: 19, endLineNumber: 1 }, 0);
assert.deepEqual(bufferRange, { assert.deepStrictEqual(bufferRange, {
start: { x: 4, y: 1 }, start: { x: 4, y: 1 },
end: { x: 7 + 1, y: 2 } end: { x: 7 + 1, y: 2 }
}); });
@ -59,7 +59,7 @@ suite('Workbench - Terminal Link Helpers', () => {
{ text: 't.com/文/', width: 9 } { text: 't.com/文/', width: 9 }
]); ]);
const bufferRange = convertLinkRangeToBuffer(lines, 11, { startColumn: 4, startLineNumber: 1, endColumn: 19, endLineNumber: 1 }, 0); const bufferRange = convertLinkRangeToBuffer(lines, 11, { startColumn: 4, startLineNumber: 1, endColumn: 19, endLineNumber: 1 }, 0);
assert.deepEqual(bufferRange, { assert.deepStrictEqual(bufferRange, {
start: { x: 4 + 1, y: 1 }, start: { x: 4 + 1, y: 1 },
end: { x: 7 + 2, y: 2 } end: { x: 7 + 2, y: 2 }
}); });
@ -70,7 +70,7 @@ suite('Workbench - Terminal Link Helpers', () => {
{ text: 't.com/文/', width: 9 } { text: 't.com/文/', width: 9 }
]); ]);
const bufferRange = convertLinkRangeToBuffer(lines, 11, { startColumn: 4 + 1, startLineNumber: 1, endColumn: 19 + 1, endLineNumber: 1 }, 0); const bufferRange = convertLinkRangeToBuffer(lines, 11, { startColumn: 4 + 1, startLineNumber: 1, endColumn: 19 + 1, endLineNumber: 1 }, 0);
assert.deepEqual(bufferRange, { assert.deepStrictEqual(bufferRange, {
start: { x: 4, y: 1 }, start: { x: 4, y: 1 },
end: { x: 7 + 1, y: 2 } end: { x: 7 + 1, y: 2 }
}); });
@ -82,7 +82,7 @@ suite('Workbench - Terminal Link Helpers', () => {
{ text: '.com/f/', width: 8 } { text: '.com/f/', width: 8 }
]); ]);
const bufferRange = convertLinkRangeToBuffer(lines, 11, { startColumn: 15, startLineNumber: 1, endColumn: 30, endLineNumber: 1 }, 0); const bufferRange = convertLinkRangeToBuffer(lines, 11, { startColumn: 15, startLineNumber: 1, endColumn: 30, endLineNumber: 1 }, 0);
assert.deepEqual(bufferRange, { assert.deepStrictEqual(bufferRange, {
start: { x: 4, y: 2 }, start: { x: 4, y: 2 },
end: { x: 7, y: 3 } end: { x: 7, y: 3 }
}); });
@ -94,7 +94,7 @@ suite('Workbench - Terminal Link Helpers', () => {
{ text: 't.com/f/', width: 9 } { text: 't.com/f/', width: 9 }
]); ]);
const bufferRange = convertLinkRangeToBuffer(lines, 11, { startColumn: 15, startLineNumber: 1, endColumn: 30, endLineNumber: 1 }, 0); const bufferRange = convertLinkRangeToBuffer(lines, 11, { startColumn: 15, startLineNumber: 1, endColumn: 30, endLineNumber: 1 }, 0);
assert.deepEqual(bufferRange, { assert.deepStrictEqual(bufferRange, {
start: { x: 4 + 1, y: 2 }, start: { x: 4 + 1, y: 2 },
end: { x: 7 + 1, y: 3 } end: { x: 7 + 1, y: 3 }
}); });
@ -106,7 +106,7 @@ suite('Workbench - Terminal Link Helpers', () => {
{ text: '.com/文/', width: 8 } { text: '.com/文/', width: 8 }
]); ]);
const bufferRange = convertLinkRangeToBuffer(lines, 11, { startColumn: 15, startLineNumber: 1, endColumn: 30, endLineNumber: 1 }, 0); const bufferRange = convertLinkRangeToBuffer(lines, 11, { startColumn: 15, startLineNumber: 1, endColumn: 30, endLineNumber: 1 }, 0);
assert.deepEqual(bufferRange, { assert.deepStrictEqual(bufferRange, {
start: { x: 4, y: 2 }, start: { x: 4, y: 2 },
end: { x: 7 + 1, y: 3 } end: { x: 7 + 1, y: 3 }
}); });
@ -118,7 +118,7 @@ suite('Workbench - Terminal Link Helpers', () => {
{ text: 't.com/文/', width: 9 } { text: 't.com/文/', width: 9 }
]); ]);
const bufferRange = convertLinkRangeToBuffer(lines, 11, { startColumn: 15, startLineNumber: 1, endColumn: 30, endLineNumber: 1 }, 0); const bufferRange = convertLinkRangeToBuffer(lines, 11, { startColumn: 15, startLineNumber: 1, endColumn: 30, endLineNumber: 1 }, 0);
assert.deepEqual(bufferRange, { assert.deepStrictEqual(bufferRange, {
start: { x: 4 + 1, y: 2 }, start: { x: 4 + 1, y: 2 },
end: { x: 7 + 2, y: 3 } end: { x: 7 + 2, y: 3 }
}); });
@ -131,7 +131,7 @@ suite('Workbench - Terminal Link Helpers', () => {
]); ]);
const bufferRange = convertLinkRangeToBuffer(lines, 11, { startColumn: 15, startLineNumber: 1, endColumn: 30, endLineNumber: 1 }, 0); const bufferRange = convertLinkRangeToBuffer(lines, 11, { startColumn: 15, startLineNumber: 1, endColumn: 30, endLineNumber: 1 }, 0);
// This test ensures that the start offset is applies to the end before it's counted // This test ensures that the start offset is applies to the end before it's counted
assert.deepEqual(bufferRange, { assert.deepStrictEqual(bufferRange, {
start: { x: 4 + 4, y: 2 }, start: { x: 4 + 4, y: 2 },
end: { x: 7 + 4, y: 3 } end: { x: 7 + 4, y: 3 }
}); });
@ -145,7 +145,7 @@ suite('Workbench - Terminal Link Helpers', () => {
]); ]);
const bufferRange = convertLinkRangeToBuffer(lines, 11, { startColumn: 15, startLineNumber: 1, endColumn: 31, endLineNumber: 1 }, 0); const bufferRange = convertLinkRangeToBuffer(lines, 11, { startColumn: 15, startLineNumber: 1, endColumn: 31, endLineNumber: 1 }, 0);
// This test ensures that the start offset is applies to the end before it's counted // This test ensures that the start offset is applies to the end before it's counted
assert.deepEqual(bufferRange, { assert.deepStrictEqual(bufferRange, {
start: { x: 4 + 4, y: 2 }, start: { x: 4 + 4, y: 2 },
end: { x: 2, y: 4 } end: { x: 2, y: 4 }
}); });

View file

@ -39,7 +39,7 @@ suite('Workbench - TerminalWebLinkProvider', () => {
end: { x: e.range[1][0], y: e.range[1][1] }, end: { x: e.range[1][0], y: e.range[1][1] },
} }
})); }));
assert.deepEqual(actual, expectedVerbose); assert.deepStrictEqual(actual, expectedVerbose);
} }
// These tests are based on LinkComputer.test.ts // These tests are based on LinkComputer.test.ts

View file

@ -101,7 +101,7 @@ suite('Workbench - TerminalValidatedLocalLinkProvider', () => {
end: { x: e.range[1][0], y: e.range[1][1] }, end: { x: e.range[1][0], y: e.range[1][1] },
} }
})); }));
assert.deepEqual(actual, expectedVerbose); assert.deepStrictEqual(actual, expectedVerbose);
} }
suite('Linux/macOS', () => { suite('Linux/macOS', () => {

View file

@ -42,7 +42,7 @@ suite('Workbench - TerminalWordLinkProvider', () => {
end: { x: e.range[1][0], y: e.range[1][1] }, end: { x: e.range[1][0], y: e.range[1][1] },
} }
})); }));
assert.deepEqual(actual, expectedVerbose); assert.deepStrictEqual(actual, expectedVerbose);
} }
test('should link words as defined by wordSeparators', async () => { test('should link words as defined by wordSeparators', async () => {

View file

@ -34,7 +34,7 @@ suite('Workbench - TerminalColorRegistry', () => {
let theme = getMockTheme(ColorScheme.HIGH_CONTRAST); let theme = getMockTheme(ColorScheme.HIGH_CONTRAST);
let colors = ansiColorIdentifiers.map(colorId => Color.Format.CSS.formatHexA(theme.getColor(colorId)!, true)); let colors = ansiColorIdentifiers.map(colorId => Color.Format.CSS.formatHexA(theme.getColor(colorId)!, true));
assert.deepEqual(colors, [ assert.deepStrictEqual(colors, [
'#000000', '#000000',
'#cd0000', '#cd0000',
'#00cd00', '#00cd00',
@ -59,7 +59,7 @@ suite('Workbench - TerminalColorRegistry', () => {
let theme = getMockTheme(ColorScheme.LIGHT); let theme = getMockTheme(ColorScheme.LIGHT);
let colors = ansiColorIdentifiers.map(colorId => Color.Format.CSS.formatHexA(theme.getColor(colorId)!, true)); let colors = ansiColorIdentifiers.map(colorId => Color.Format.CSS.formatHexA(theme.getColor(colorId)!, true));
assert.deepEqual(colors, [ assert.deepStrictEqual(colors, [
'#000000', '#000000',
'#cd3131', '#cd3131',
'#00bc00', '#00bc00',
@ -84,7 +84,7 @@ suite('Workbench - TerminalColorRegistry', () => {
let theme = getMockTheme(ColorScheme.DARK); let theme = getMockTheme(ColorScheme.DARK);
let colors = ansiColorIdentifiers.map(colorId => Color.Format.CSS.formatHexA(theme.getColor(colorId)!, true)); let colors = ansiColorIdentifiers.map(colorId => Color.Format.CSS.formatHexA(theme.getColor(colorId)!, true));
assert.deepEqual(colors, [ assert.deepStrictEqual(colors, [
'#000000', '#000000',
'#cd3131', '#cd3131',
'#0dbc79', '#0dbc79',

View file

@ -126,7 +126,7 @@ suite('Workbench - TerminalEnvironment', () => {
c: 'd' c: 'd'
}; };
mergeEnvironments(parent, other); mergeEnvironments(parent, other);
assert.deepEqual(parent, { assert.deepStrictEqual(parent, {
a: 'b', a: 'b',
c: 'd' c: 'd'
}); });
@ -140,7 +140,7 @@ suite('Workbench - TerminalEnvironment', () => {
A: 'c' A: 'c'
}; };
mergeEnvironments(parent, other); mergeEnvironments(parent, other);
assert.deepEqual(parent, { assert.deepStrictEqual(parent, {
a: 'c' a: 'c'
}); });
}); });
@ -154,7 +154,7 @@ suite('Workbench - TerminalEnvironment', () => {
a: null a: null
}; };
mergeEnvironments(parent, other); mergeEnvironments(parent, other);
assert.deepEqual(parent, { assert.deepStrictEqual(parent, {
c: 'd' c: 'd'
}); });
}); });
@ -168,7 +168,7 @@ suite('Workbench - TerminalEnvironment', () => {
A: null A: null
}; };
mergeEnvironments(parent, other); mergeEnvironments(parent, other);
assert.deepEqual(parent, { assert.deepStrictEqual(parent, {
c: 'd' c: 'd'
}); });
}); });

View file

@ -18,7 +18,7 @@ function linkNotAllowedByRules(link: string, rules: string[]) {
suite('GitHub remote extraction', () => { suite('GitHub remote extraction', () => {
test('All known formats', () => { test('All known formats', () => {
assert.deepEqual( assert.deepStrictEqual(
extractGitHubRemotesFromGitConfig( extractGitHubRemotesFromGitConfig(
` `
[remote "1"] [remote "1"]

View file

@ -130,7 +130,7 @@ suite('CommandService', function () {
return service.executeCommand('farboo').then(() => { return service.executeCommand('farboo').then(() => {
assert.strictEqual(callCounter, 1); assert.strictEqual(callCounter, 1);
assert.deepEqual(events.sort(), ['*', 'onCommand:farboo'].sort()); assert.deepStrictEqual(events.sort(), ['*', 'onCommand:farboo'].sort());
}).finally(() => { }).finally(() => {
disposable.dispose(); disposable.dispose();
}); });
@ -170,7 +170,7 @@ suite('CommandService', function () {
}, new NullLogService()); }, new NullLogService());
return service.executeCommand('farboo2').then(() => { return service.executeCommand('farboo2').then(() => {
assert.deepEqual(actualOrder, expectedOrder); assert.deepStrictEqual(actualOrder, expectedOrder);
}).finally(() => { }).finally(() => {
disposables.dispose(); disposables.dispose();
}); });

View file

@ -196,7 +196,7 @@ suite('ConfigurationEditingService', () => {
const contents = await fileService.readFile(environmentService.settingsResource); const contents = await fileService.readFile(environmentService.settingsResource);
const parsed = json.parse(contents.value.toString()); const parsed = json.parse(contents.value.toString());
assert.deepEqual(Object.keys(parsed), ['my.super.setting']); assert.deepStrictEqual(Object.keys(parsed), ['my.super.setting']);
assert.strictEqual(parsed['my.super.setting'], 'my.super.value'); assert.strictEqual(parsed['my.super.setting'], 'my.super.value');
}); });
@ -206,7 +206,7 @@ suite('ConfigurationEditingService', () => {
const contents = await fileService.readFile(environmentService.settingsResource); const contents = await fileService.readFile(environmentService.settingsResource);
const parsed = json.parse(contents.value.toString()); const parsed = json.parse(contents.value.toString());
assert.deepEqual(Object.keys(parsed), ['my.super.setting']); assert.deepStrictEqual(Object.keys(parsed), ['my.super.setting']);
assert.strictEqual(parsed['my.super.setting'], 'my.super.value'); assert.strictEqual(parsed['my.super.setting'], 'my.super.value');
}); });
@ -217,7 +217,7 @@ suite('ConfigurationEditingService', () => {
const contents = await fileService.readFile(environmentService.settingsResource); const contents = await fileService.readFile(environmentService.settingsResource);
const parsed = json.parse(contents.value.toString()); const parsed = json.parse(contents.value.toString());
assert.deepEqual(parsed[key], value); assert.deepStrictEqual(parsed[key], value);
}); });
test('write overridable settings to workspace settings', async () => { test('write overridable settings to workspace settings', async () => {
@ -227,7 +227,7 @@ suite('ConfigurationEditingService', () => {
const contents = await fileService.readFile(joinPath(workspaceService.getWorkspace().folders[0].uri, FOLDER_SETTINGS_PATH)); const contents = await fileService.readFile(joinPath(workspaceService.getWorkspace().folders[0].uri, FOLDER_SETTINGS_PATH));
const parsed = json.parse(contents.value.toString()); const parsed = json.parse(contents.value.toString());
assert.deepEqual(parsed[key], value); assert.deepStrictEqual(parsed[key], value);
}); });
test('write overridable settings to workspace folder settings', async () => { test('write overridable settings to workspace folder settings', async () => {
@ -238,7 +238,7 @@ suite('ConfigurationEditingService', () => {
const contents = await fileService.readFile(folderSettingsFile); const contents = await fileService.readFile(folderSettingsFile);
const parsed = json.parse(contents.value.toString()); const parsed = json.parse(contents.value.toString());
assert.deepEqual(parsed[key], value); assert.deepStrictEqual(parsed[key], value);
}); });
test('write workspace standalone setting - empty file', async () => { test('write workspace standalone setting - empty file', async () => {

View file

@ -269,9 +269,9 @@ suite('WorkspaceContextService - Workspace Editing', () => {
assert.strictEqual(target.callCount, 1, `Should be called only once but called ${target.callCount} times`); assert.strictEqual(target.callCount, 1, `Should be called only once but called ${target.callCount} times`);
const actual_1 = (<IWorkspaceFoldersChangeEvent>target.args[0][0]); const actual_1 = (<IWorkspaceFoldersChangeEvent>target.args[0][0]);
assert.deepEqual(actual_1.added.map(r => r.uri.toString()), addedFolders.map(a => a.uri.toString())); assert.deepStrictEqual(actual_1.added.map(r => r.uri.toString()), addedFolders.map(a => a.uri.toString()));
assert.deepEqual(actual_1.removed, []); assert.deepStrictEqual(actual_1.removed, []);
assert.deepEqual(actual_1.changed, []); assert.deepStrictEqual(actual_1.changed, []);
}); });
test('remove folders', async () => { test('remove folders', async () => {
@ -290,9 +290,9 @@ suite('WorkspaceContextService - Workspace Editing', () => {
assert.strictEqual(target.callCount, 1, `Should be called only once but called ${target.callCount} times`); assert.strictEqual(target.callCount, 1, `Should be called only once but called ${target.callCount} times`);
const actual_1 = (<IWorkspaceFoldersChangeEvent>target.args[0][0]); const actual_1 = (<IWorkspaceFoldersChangeEvent>target.args[0][0]);
assert.deepEqual(actual_1.added, []); assert.deepStrictEqual(actual_1.added, []);
assert.deepEqual(actual_1.removed.map(r => r.uri.toString()), [removedFolder.uri.toString()]); assert.deepStrictEqual(actual_1.removed.map(r => r.uri.toString()), [removedFolder.uri.toString()]);
assert.deepEqual(actual_1.changed.map(c => c.uri.toString()), [testObject.getWorkspace().folders[0].uri.toString()]); assert.deepStrictEqual(actual_1.changed.map(c => c.uri.toString()), [testObject.getWorkspace().folders[0].uri.toString()]);
}); });
test('remove folders and add them back by writing into the file', async () => { test('remove folders and add them back by writing into the file', async () => {
@ -302,7 +302,7 @@ suite('WorkspaceContextService - Workspace Editing', () => {
const promise = new Promise<void>((resolve, reject) => { const promise = new Promise<void>((resolve, reject) => {
testObject.onDidChangeWorkspaceFolders(actual => { testObject.onDidChangeWorkspaceFolders(actual => {
try { try {
assert.deepEqual(actual.added.map(r => r.uri.toString()), [folders[0].uri.toString()]); assert.deepStrictEqual(actual.added.map(r => r.uri.toString()), [folders[0].uri.toString()]);
resolve(); resolve();
} catch (error) { } catch (error) {
reject(error); reject(error);
@ -324,9 +324,9 @@ suite('WorkspaceContextService - Workspace Editing', () => {
assert.strictEqual(target.callCount, 1, `Should be called only once but called ${target.callCount} times`); assert.strictEqual(target.callCount, 1, `Should be called only once but called ${target.callCount} times`);
const actual_1 = (<IWorkspaceFoldersChangeEvent>target.args[0][0]); const actual_1 = (<IWorkspaceFoldersChangeEvent>target.args[0][0]);
assert.deepEqual(actual_1.added.map(r => r.uri.toString()), addedFolders.map(a => a.uri.toString())); assert.deepStrictEqual(actual_1.added.map(r => r.uri.toString()), addedFolders.map(a => a.uri.toString()));
assert.deepEqual(actual_1.removed.map(r_1 => r_1.uri.toString()), removedFolders.map(a_1 => a_1.toString())); assert.deepStrictEqual(actual_1.removed.map(r_1 => r_1.uri.toString()), removedFolders.map(a_1 => a_1.toString()));
assert.deepEqual(actual_1.changed, []); assert.deepStrictEqual(actual_1.changed, []);
}); });
test('update folders (rename first via add and remove)', async () => { test('update folders (rename first via add and remove)', async () => {
@ -338,9 +338,9 @@ suite('WorkspaceContextService - Workspace Editing', () => {
assert.strictEqual(target.callCount, 1, `Should be called only once but called ${target.callCount} times`); assert.strictEqual(target.callCount, 1, `Should be called only once but called ${target.callCount} times`);
const actual_1 = (<IWorkspaceFoldersChangeEvent>target.args[0][0]); const actual_1 = (<IWorkspaceFoldersChangeEvent>target.args[0][0]);
assert.deepEqual(actual_1.added, []); assert.deepStrictEqual(actual_1.added, []);
assert.deepEqual(actual_1.removed, []); assert.deepStrictEqual(actual_1.removed, []);
assert.deepEqual(actual_1.changed.map(r => r.uri.toString()), removedFolders.map(a => a.toString())); assert.deepStrictEqual(actual_1.changed.map(r => r.uri.toString()), removedFolders.map(a => a.toString()));
}); });
test('update folders (remove first and add to end)', async () => { test('update folders (remove first and add to end)', async () => {
@ -353,9 +353,9 @@ suite('WorkspaceContextService - Workspace Editing', () => {
assert.strictEqual(target.callCount, 1, `Should be called only once but called ${target.callCount} times`); assert.strictEqual(target.callCount, 1, `Should be called only once but called ${target.callCount} times`);
const actual_1 = (<IWorkspaceFoldersChangeEvent>target.args[0][0]); const actual_1 = (<IWorkspaceFoldersChangeEvent>target.args[0][0]);
assert.deepEqual(actual_1.added.map(r => r.uri.toString()), addedFolders.map(a => a.uri.toString())); assert.deepStrictEqual(actual_1.added.map(r => r.uri.toString()), addedFolders.map(a => a.uri.toString()));
assert.deepEqual(actual_1.removed.map(r_1 => r_1.uri.toString()), removedFolders.map(a_1 => a_1.toString())); assert.deepStrictEqual(actual_1.removed.map(r_1 => r_1.uri.toString()), removedFolders.map(a_1 => a_1.toString()));
assert.deepEqual(actual_1.changed.map(r_2 => r_2.uri.toString()), changedFolders.map(a_2 => a_2.toString())); assert.deepStrictEqual(actual_1.changed.map(r_2 => r_2.uri.toString()), changedFolders.map(a_2 => a_2.toString()));
}); });
test('reorder folders trigger change event', async () => { test('reorder folders trigger change event', async () => {
@ -367,9 +367,9 @@ suite('WorkspaceContextService - Workspace Editing', () => {
assert.strictEqual(target.callCount, 1, `Should be called only once but called ${target.callCount} times`); assert.strictEqual(target.callCount, 1, `Should be called only once but called ${target.callCount} times`);
const actual_1 = (<IWorkspaceFoldersChangeEvent>target.args[0][0]); const actual_1 = (<IWorkspaceFoldersChangeEvent>target.args[0][0]);
assert.deepEqual(actual_1.added, []); assert.deepStrictEqual(actual_1.added, []);
assert.deepEqual(actual_1.removed, []); assert.deepStrictEqual(actual_1.removed, []);
assert.deepEqual(actual_1.changed.map(c => c.uri.toString()), testObject.getWorkspace().folders.map(f => f.uri.toString()).reverse()); assert.deepStrictEqual(actual_1.changed.map(c => c.uri.toString()), testObject.getWorkspace().folders.map(f => f.uri.toString()).reverse());
}); });
test('rename folders trigger change event', async () => { test('rename folders trigger change event', async () => {
@ -381,9 +381,9 @@ suite('WorkspaceContextService - Workspace Editing', () => {
assert.strictEqual(target.callCount, 1, `Should be called only once but called ${target.callCount} times`); assert.strictEqual(target.callCount, 1, `Should be called only once but called ${target.callCount} times`);
const actual_1 = (<IWorkspaceFoldersChangeEvent>target.args[0][0]); const actual_1 = (<IWorkspaceFoldersChangeEvent>target.args[0][0]);
assert.deepEqual(actual_1.added, []); assert.deepStrictEqual(actual_1.added, []);
assert.deepEqual(actual_1.removed, []); assert.deepStrictEqual(actual_1.removed, []);
assert.deepEqual(actual_1.changed.map(c => c.uri.toString()), [testObject.getWorkspace().folders[0].uri.toString()]); assert.deepStrictEqual(actual_1.changed.map(c => c.uri.toString()), [testObject.getWorkspace().folders[0].uri.toString()]);
}); });
}); });
@ -465,11 +465,11 @@ suite('WorkspaceService - Initialization', () => {
assert.strictEqual(testObject.getValue('initialization.testSetting1'), 'userValue'); assert.strictEqual(testObject.getValue('initialization.testSetting1'), 'userValue');
assert.strictEqual(target.callCount, 3); assert.strictEqual(target.callCount, 3);
assert.deepEqual(target.args[0], [WorkbenchState.FOLDER]); assert.deepStrictEqual(target.args[0], [WorkbenchState.FOLDER]);
assert.deepEqual(target.args[1], [undefined]); assert.deepStrictEqual(target.args[1], [undefined]);
assert.deepEqual((<IWorkspaceFoldersChangeEvent>target.args[2][0]).added.map(f => f.uri.toString()), [folder.toString()]); assert.deepStrictEqual((<IWorkspaceFoldersChangeEvent>target.args[2][0]).added.map(f => f.uri.toString()), [folder.toString()]);
assert.deepEqual((<IWorkspaceFoldersChangeEvent>target.args[2][0]).removed, []); assert.deepStrictEqual((<IWorkspaceFoldersChangeEvent>target.args[2][0]).removed, []);
assert.deepEqual((<IWorkspaceFoldersChangeEvent>target.args[2][0]).changed, []); assert.deepStrictEqual((<IWorkspaceFoldersChangeEvent>target.args[2][0]).changed, []);
}); });
@ -490,12 +490,12 @@ suite('WorkspaceService - Initialization', () => {
assert.strictEqual(testObject.getValue('initialization.testSetting1'), 'workspaceValue'); assert.strictEqual(testObject.getValue('initialization.testSetting1'), 'workspaceValue');
assert.strictEqual(target.callCount, 4); assert.strictEqual(target.callCount, 4);
assert.deepEqual((<IConfigurationChangeEvent>target.args[0][0]).affectedKeys, ['initialization.testSetting1']); assert.deepStrictEqual((<IConfigurationChangeEvent>target.args[0][0]).affectedKeys, ['initialization.testSetting1']);
assert.deepEqual(target.args[1], [WorkbenchState.FOLDER]); assert.deepStrictEqual(target.args[1], [WorkbenchState.FOLDER]);
assert.deepEqual(target.args[2], [undefined]); assert.deepStrictEqual(target.args[2], [undefined]);
assert.deepEqual((<IWorkspaceFoldersChangeEvent>target.args[3][0]).added.map(f => f.uri.toString()), [folder.toString()]); assert.deepStrictEqual((<IWorkspaceFoldersChangeEvent>target.args[3][0]).added.map(f => f.uri.toString()), [folder.toString()]);
assert.deepEqual((<IWorkspaceFoldersChangeEvent>target.args[3][0]).removed, []); assert.deepStrictEqual((<IWorkspaceFoldersChangeEvent>target.args[3][0]).removed, []);
assert.deepEqual((<IWorkspaceFoldersChangeEvent>target.args[3][0]).changed, []); assert.deepStrictEqual((<IWorkspaceFoldersChangeEvent>target.args[3][0]).changed, []);
}); });
@ -513,11 +513,11 @@ suite('WorkspaceService - Initialization', () => {
await testObject.initialize(getWorkspaceIdentifier(configResource)); await testObject.initialize(getWorkspaceIdentifier(configResource));
assert.strictEqual(target.callCount, 3); assert.strictEqual(target.callCount, 3);
assert.deepEqual(target.args[0], [WorkbenchState.WORKSPACE]); assert.deepStrictEqual(target.args[0], [WorkbenchState.WORKSPACE]);
assert.deepEqual(target.args[1], [undefined]); assert.deepStrictEqual(target.args[1], [undefined]);
assert.deepEqual((<IWorkspaceFoldersChangeEvent>target.args[2][0]).added.map(folder => folder.uri.toString()), [joinPath(ROOT, 'a').toString(), joinPath(ROOT, 'b').toString()]); assert.deepStrictEqual((<IWorkspaceFoldersChangeEvent>target.args[2][0]).added.map(folder => folder.uri.toString()), [joinPath(ROOT, 'a').toString(), joinPath(ROOT, 'b').toString()]);
assert.deepEqual((<IWorkspaceFoldersChangeEvent>target.args[2][0]).removed, []); assert.deepStrictEqual((<IWorkspaceFoldersChangeEvent>target.args[2][0]).removed, []);
assert.deepEqual((<IWorkspaceFoldersChangeEvent>target.args[2][0]).changed, []); assert.deepStrictEqual((<IWorkspaceFoldersChangeEvent>target.args[2][0]).changed, []);
}); });
@ -537,12 +537,12 @@ suite('WorkspaceService - Initialization', () => {
await testObject.initialize(getWorkspaceIdentifier(configResource)); await testObject.initialize(getWorkspaceIdentifier(configResource));
assert.strictEqual(target.callCount, 4); assert.strictEqual(target.callCount, 4);
assert.deepEqual((<IConfigurationChangeEvent>target.args[0][0]).affectedKeys, ['initialization.testSetting1', 'initialization.testSetting2']); assert.deepStrictEqual((<IConfigurationChangeEvent>target.args[0][0]).affectedKeys, ['initialization.testSetting1', 'initialization.testSetting2']);
assert.deepEqual(target.args[1], [WorkbenchState.WORKSPACE]); assert.deepStrictEqual(target.args[1], [WorkbenchState.WORKSPACE]);
assert.deepEqual(target.args[2], [undefined]); assert.deepStrictEqual(target.args[2], [undefined]);
assert.deepEqual((<IWorkspaceFoldersChangeEvent>target.args[3][0]).added.map(folder => folder.uri.toString()), [joinPath(ROOT, 'a').toString(), joinPath(ROOT, 'b').toString()]); assert.deepStrictEqual((<IWorkspaceFoldersChangeEvent>target.args[3][0]).added.map(folder => folder.uri.toString()), [joinPath(ROOT, 'a').toString(), joinPath(ROOT, 'b').toString()]);
assert.deepEqual((<IWorkspaceFoldersChangeEvent>target.args[3][0]).removed, []); assert.deepStrictEqual((<IWorkspaceFoldersChangeEvent>target.args[3][0]).removed, []);
assert.deepEqual((<IWorkspaceFoldersChangeEvent>target.args[3][0]).changed, []); assert.deepStrictEqual((<IWorkspaceFoldersChangeEvent>target.args[3][0]).changed, []);
}); });
@ -561,9 +561,9 @@ suite('WorkspaceService - Initialization', () => {
assert.strictEqual(testObject.getValue('initialization.testSetting1'), 'userValue'); assert.strictEqual(testObject.getValue('initialization.testSetting1'), 'userValue');
assert.strictEqual(target.callCount, 1); assert.strictEqual(target.callCount, 1);
assert.deepEqual((<IWorkspaceFoldersChangeEvent>target.args[0][0]).added.map(folder_1 => folder_1.uri.toString()), [joinPath(ROOT, 'b').toString()]); assert.deepStrictEqual((<IWorkspaceFoldersChangeEvent>target.args[0][0]).added.map(folder_1 => folder_1.uri.toString()), [joinPath(ROOT, 'b').toString()]);
assert.deepEqual((<IWorkspaceFoldersChangeEvent>target.args[0][0]).removed.map(folder_2 => folder_2.uri.toString()), [joinPath(ROOT, 'a').toString()]); assert.deepStrictEqual((<IWorkspaceFoldersChangeEvent>target.args[0][0]).removed.map(folder_2 => folder_2.uri.toString()), [joinPath(ROOT, 'a').toString()]);
assert.deepEqual((<IWorkspaceFoldersChangeEvent>target.args[0][0]).changed, []); assert.deepStrictEqual((<IWorkspaceFoldersChangeEvent>target.args[0][0]).changed, []);
}); });
@ -581,10 +581,10 @@ suite('WorkspaceService - Initialization', () => {
assert.strictEqual(testObject.getValue('initialization.testSetting1'), 'workspaceValue2'); assert.strictEqual(testObject.getValue('initialization.testSetting1'), 'workspaceValue2');
assert.strictEqual(target.callCount, 2); assert.strictEqual(target.callCount, 2);
assert.deepEqual((<IConfigurationChangeEvent>target.args[0][0]).affectedKeys, ['initialization.testSetting1']); assert.deepStrictEqual((<IConfigurationChangeEvent>target.args[0][0]).affectedKeys, ['initialization.testSetting1']);
assert.deepEqual((<IWorkspaceFoldersChangeEvent>target.args[1][0]).added.map(folder_1 => folder_1.uri.toString()), [joinPath(ROOT, 'b').toString()]); assert.deepStrictEqual((<IWorkspaceFoldersChangeEvent>target.args[1][0]).added.map(folder_1 => folder_1.uri.toString()), [joinPath(ROOT, 'b').toString()]);
assert.deepEqual((<IWorkspaceFoldersChangeEvent>target.args[1][0]).removed.map(folder_2 => folder_2.uri.toString()), [joinPath(ROOT, 'a').toString()]); assert.deepStrictEqual((<IWorkspaceFoldersChangeEvent>target.args[1][0]).removed.map(folder_2 => folder_2.uri.toString()), [joinPath(ROOT, 'a').toString()]);
assert.deepEqual((<IWorkspaceFoldersChangeEvent>target.args[1][0]).changed, []); assert.deepStrictEqual((<IWorkspaceFoldersChangeEvent>target.args[1][0]).changed, []);
}); });
@ -600,12 +600,12 @@ suite('WorkspaceService - Initialization', () => {
await testObject.initialize(getWorkspaceIdentifier(configResource)); await testObject.initialize(getWorkspaceIdentifier(configResource));
assert.strictEqual(target.callCount, 4); assert.strictEqual(target.callCount, 4);
assert.deepEqual((<IConfigurationChangeEvent>target.args[0][0]).affectedKeys, ['initialization.testSetting1']); assert.deepStrictEqual((<IConfigurationChangeEvent>target.args[0][0]).affectedKeys, ['initialization.testSetting1']);
assert.deepEqual(target.args[1], [WorkbenchState.WORKSPACE]); assert.deepStrictEqual(target.args[1], [WorkbenchState.WORKSPACE]);
assert.deepEqual(target.args[2], [undefined]); assert.deepStrictEqual(target.args[2], [undefined]);
assert.deepEqual((<IWorkspaceFoldersChangeEvent>target.args[3][0]).added.map(folder_1 => folder_1.uri.toString()), [joinPath(ROOT, 'b').toString()]); assert.deepStrictEqual((<IWorkspaceFoldersChangeEvent>target.args[3][0]).added.map(folder_1 => folder_1.uri.toString()), [joinPath(ROOT, 'b').toString()]);
assert.deepEqual((<IWorkspaceFoldersChangeEvent>target.args[3][0]).removed, []); assert.deepStrictEqual((<IWorkspaceFoldersChangeEvent>target.args[3][0]).removed, []);
assert.deepEqual((<IWorkspaceFoldersChangeEvent>target.args[3][0]).changed, []); assert.deepStrictEqual((<IWorkspaceFoldersChangeEvent>target.args[3][0]).changed, []);
}); });
}); });
@ -680,7 +680,7 @@ suite('WorkspaceConfigurationService - Folder', () => {
teardown(() => disposables.clear()); teardown(() => disposables.clear());
test('defaults', () => { test('defaults', () => {
assert.deepEqual(testObject.getValue('configurationService'), { 'folder': { 'applicationSetting': 'isSet', 'machineSetting': 'isSet', 'machineOverridableSetting': 'isSet', 'testSetting': 'isSet', 'languageSetting': 'isSet' } }); assert.deepStrictEqual(testObject.getValue('configurationService'), { 'folder': { 'applicationSetting': 'isSet', 'machineSetting': 'isSet', 'machineOverridableSetting': 'isSet', 'testSetting': 'isSet', 'languageSetting': 'isSet' } });
}); });
test('globals override defaults', async () => { test('globals override defaults', async () => {
@ -949,25 +949,25 @@ suite('WorkspaceConfigurationService - Folder', () => {
test('keys', async () => { test('keys', async () => {
let actual = testObject.keys(); let actual = testObject.keys();
assert.ok(actual.default.indexOf('configurationService.folder.testSetting') !== -1); assert.ok(actual.default.indexOf('configurationService.folder.testSetting') !== -1);
assert.deepEqual(actual.user, []); assert.deepStrictEqual(actual.user, []);
assert.deepEqual(actual.workspace, []); assert.deepStrictEqual(actual.workspace, []);
assert.deepEqual(actual.workspaceFolder, []); assert.deepStrictEqual(actual.workspaceFolder, []);
await fileService.writeFile(environmentService.settingsResource, VSBuffer.fromString('{ "configurationService.folder.testSetting": "userValue" }')); await fileService.writeFile(environmentService.settingsResource, VSBuffer.fromString('{ "configurationService.folder.testSetting": "userValue" }'));
await testObject.reloadConfiguration(); await testObject.reloadConfiguration();
actual = testObject.keys(); actual = testObject.keys();
assert.ok(actual.default.indexOf('configurationService.folder.testSetting') !== -1); assert.ok(actual.default.indexOf('configurationService.folder.testSetting') !== -1);
assert.deepEqual(actual.user, ['configurationService.folder.testSetting']); assert.deepStrictEqual(actual.user, ['configurationService.folder.testSetting']);
assert.deepEqual(actual.workspace, []); assert.deepStrictEqual(actual.workspace, []);
assert.deepEqual(actual.workspaceFolder, []); assert.deepStrictEqual(actual.workspaceFolder, []);
await fileService.writeFile(joinPath(workspaceService.getWorkspace().folders[0].uri, '.vscode', 'settings.json'), VSBuffer.fromString('{ "configurationService.folder.testSetting": "workspaceValue" }')); await fileService.writeFile(joinPath(workspaceService.getWorkspace().folders[0].uri, '.vscode', 'settings.json'), VSBuffer.fromString('{ "configurationService.folder.testSetting": "workspaceValue" }'));
await testObject.reloadConfiguration(); await testObject.reloadConfiguration();
actual = testObject.keys(); actual = testObject.keys();
assert.ok(actual.default.indexOf('configurationService.folder.testSetting') !== -1); assert.ok(actual.default.indexOf('configurationService.folder.testSetting') !== -1);
assert.deepEqual(actual.user, ['configurationService.folder.testSetting']); assert.deepStrictEqual(actual.user, ['configurationService.folder.testSetting']);
assert.deepEqual(actual.workspace, ['configurationService.folder.testSetting']); assert.deepStrictEqual(actual.workspace, ['configurationService.folder.testSetting']);
assert.deepEqual(actual.workspaceFolder, []); assert.deepStrictEqual(actual.workspaceFolder, []);
}); });
test('update user configuration', () => { test('update user configuration', () => {
@ -1002,7 +1002,7 @@ suite('WorkspaceConfigurationService - Folder', () => {
test('update tasks configuration', () => { test('update tasks configuration', () => {
return testObject.updateValue('tasks', { 'version': '1.0.0', tasks: [{ 'taskName': 'myTask' }] }, ConfigurationTarget.WORKSPACE) return testObject.updateValue('tasks', { 'version': '1.0.0', tasks: [{ 'taskName': 'myTask' }] }, ConfigurationTarget.WORKSPACE)
.then(() => assert.deepEqual(testObject.getValue('tasks'), { 'version': '1.0.0', tasks: [{ 'taskName': 'myTask' }] })); .then(() => assert.deepStrictEqual(testObject.getValue('tasks'), { 'version': '1.0.0', tasks: [{ 'taskName': 'myTask' }] }));
}); });
test('update user configuration should trigger change event before promise is resolve', () => { test('update user configuration should trigger change event before promise is resolve', () => {
@ -1506,7 +1506,7 @@ suite('WorkspaceConfigurationService-Multiroot', () => {
await jsonEditingServce.write((workspaceContextService.getWorkspace().configuration!), [{ path: ['launch'], value: expectedLaunchConfiguration }], true); await jsonEditingServce.write((workspaceContextService.getWorkspace().configuration!), [{ path: ['launch'], value: expectedLaunchConfiguration }], true);
await testObject.reloadConfiguration(); await testObject.reloadConfiguration();
const actual = testObject.getValue('launch'); const actual = testObject.getValue('launch');
assert.deepEqual(actual, expectedLaunchConfiguration); assert.deepStrictEqual(actual, expectedLaunchConfiguration);
}); });
test('inspect launch configuration', async () => { test('inspect launch configuration', async () => {
@ -1529,7 +1529,7 @@ suite('WorkspaceConfigurationService-Multiroot', () => {
await jsonEditingServce.write((workspaceContextService.getWorkspace().configuration!), [{ path: ['launch'], value: expectedLaunchConfiguration }], true); await jsonEditingServce.write((workspaceContextService.getWorkspace().configuration!), [{ path: ['launch'], value: expectedLaunchConfiguration }], true);
await testObject.reloadConfiguration(); await testObject.reloadConfiguration();
const actual = testObject.inspect('launch').workspaceValue; const actual = testObject.inspect('launch').workspaceValue;
assert.deepEqual(actual, expectedLaunchConfiguration); assert.deepStrictEqual(actual, expectedLaunchConfiguration);
}); });
@ -1551,7 +1551,7 @@ suite('WorkspaceConfigurationService-Multiroot', () => {
await jsonEditingServce.write((workspaceContextService.getWorkspace().configuration!), [{ path: ['tasks'], value: expectedTasksConfiguration }], true); await jsonEditingServce.write((workspaceContextService.getWorkspace().configuration!), [{ path: ['tasks'], value: expectedTasksConfiguration }], true);
await testObject.reloadConfiguration(); await testObject.reloadConfiguration();
const actual = testObject.getValue('tasks'); const actual = testObject.getValue('tasks');
assert.deepEqual(actual, expectedTasksConfiguration); assert.deepStrictEqual(actual, expectedTasksConfiguration);
}); });
test('inspect tasks configuration', async () => { test('inspect tasks configuration', async () => {
@ -1572,7 +1572,7 @@ suite('WorkspaceConfigurationService-Multiroot', () => {
await jsonEditingServce.write(workspaceContextService.getWorkspace().configuration!, [{ path: ['tasks'], value: expectedTasksConfiguration }], true); await jsonEditingServce.write(workspaceContextService.getWorkspace().configuration!, [{ path: ['tasks'], value: expectedTasksConfiguration }], true);
await testObject.reloadConfiguration(); await testObject.reloadConfiguration();
const actual = testObject.inspect('tasks').workspaceValue; const actual = testObject.inspect('tasks').workspaceValue;
assert.deepEqual(actual, expectedTasksConfiguration); assert.deepStrictEqual(actual, expectedTasksConfiguration);
}); });
test('update user configuration', async () => { test('update user configuration', async () => {
@ -1669,20 +1669,20 @@ suite('WorkspaceConfigurationService-Multiroot', () => {
test('update tasks configuration in a folder', async () => { test('update tasks configuration in a folder', async () => {
const workspace = workspaceContextService.getWorkspace(); const workspace = workspaceContextService.getWorkspace();
await testObject.updateValue('tasks', { 'version': '1.0.0', tasks: [{ 'taskName': 'myTask' }] }, { resource: workspace.folders[0].uri }, ConfigurationTarget.WORKSPACE_FOLDER); await testObject.updateValue('tasks', { 'version': '1.0.0', tasks: [{ 'taskName': 'myTask' }] }, { resource: workspace.folders[0].uri }, ConfigurationTarget.WORKSPACE_FOLDER);
assert.deepEqual(testObject.getValue('tasks', { resource: workspace.folders[0].uri }), { 'version': '1.0.0', tasks: [{ 'taskName': 'myTask' }] }); assert.deepStrictEqual(testObject.getValue('tasks', { resource: workspace.folders[0].uri }), { 'version': '1.0.0', tasks: [{ 'taskName': 'myTask' }] });
}); });
test('update launch configuration in a workspace', async () => { test('update launch configuration in a workspace', async () => {
const workspace = workspaceContextService.getWorkspace(); const workspace = workspaceContextService.getWorkspace();
await testObject.updateValue('launch', { 'version': '1.0.0', configurations: [{ 'name': 'myLaunch' }] }, { resource: workspace.folders[0].uri }, ConfigurationTarget.WORKSPACE, true); await testObject.updateValue('launch', { 'version': '1.0.0', configurations: [{ 'name': 'myLaunch' }] }, { resource: workspace.folders[0].uri }, ConfigurationTarget.WORKSPACE, true);
assert.deepEqual(testObject.getValue('launch'), { 'version': '1.0.0', configurations: [{ 'name': 'myLaunch' }] }); assert.deepStrictEqual(testObject.getValue('launch'), { 'version': '1.0.0', configurations: [{ 'name': 'myLaunch' }] });
}); });
test('update tasks configuration in a workspace', async () => { test('update tasks configuration in a workspace', async () => {
const workspace = workspaceContextService.getWorkspace(); const workspace = workspaceContextService.getWorkspace();
const tasks = { 'version': '2.0.0', tasks: [{ 'label': 'myTask' }] }; const tasks = { 'version': '2.0.0', tasks: [{ 'label': 'myTask' }] };
await testObject.updateValue('tasks', tasks, { resource: workspace.folders[0].uri }, ConfigurationTarget.WORKSPACE, true); await testObject.updateValue('tasks', tasks, { resource: workspace.folders[0].uri }, ConfigurationTarget.WORKSPACE, true);
assert.deepEqual(testObject.getValue('tasks'), tasks); assert.deepStrictEqual(testObject.getValue('tasks'), tasks);
}); });
test('configuration of newly added folder is available on configuration change event', async () => { test('configuration of newly added folder is available on configuration change event', async () => {
@ -1815,7 +1815,7 @@ suite('WorkspaceConfigurationService - Remote Folder', () => {
testObject.onDidChangeConfiguration(event => { testObject.onDidChangeConfiguration(event => {
try { try {
assert.strictEqual(event.source, ConfigurationTarget.USER); assert.strictEqual(event.source, ConfigurationTarget.USER);
assert.deepEqual(event.affectedKeys, ['configurationService.remote.machineSetting']); assert.deepStrictEqual(event.affectedKeys, ['configurationService.remote.machineSetting']);
assert.strictEqual(testObject.getValue('configurationService.remote.machineSetting'), 'remoteValue'); assert.strictEqual(testObject.getValue('configurationService.remote.machineSetting'), 'remoteValue');
c(); c();
} catch (error) { } catch (error) {
@ -1835,7 +1835,7 @@ suite('WorkspaceConfigurationService - Remote Folder', () => {
testObject.onDidChangeConfiguration(event => { testObject.onDidChangeConfiguration(event => {
try { try {
assert.strictEqual(event.source, ConfigurationTarget.USER); assert.strictEqual(event.source, ConfigurationTarget.USER);
assert.deepEqual(event.affectedKeys, ['configurationService.remote.machineSetting']); assert.deepStrictEqual(event.affectedKeys, ['configurationService.remote.machineSetting']);
assert.strictEqual(testObject.getValue('configurationService.remote.machineSetting'), 'remoteValue'); assert.strictEqual(testObject.getValue('configurationService.remote.machineSetting'), 'remoteValue');
c(); c();
} catch (error) { } catch (error) {
@ -1951,12 +1951,12 @@ suite('ConfigurationService - Configuration Defaults', () => {
test('when default value is not overriden', () => { test('when default value is not overriden', () => {
const testObject = createConfigurationService({}); const testObject = createConfigurationService({});
assert.deepEqual(testObject.getValue('configurationService.defaultOverridesSetting'), 'isSet'); assert.deepStrictEqual(testObject.getValue('configurationService.defaultOverridesSetting'), 'isSet');
}); });
test('when default value is overriden', () => { test('when default value is overriden', () => {
const testObject = createConfigurationService({ 'configurationService.defaultOverridesSetting': 'overriddenValue' }); const testObject = createConfigurationService({ 'configurationService.defaultOverridesSetting': 'overriddenValue' });
assert.deepEqual(testObject.getValue('configurationService.defaultOverridesSetting'), 'overriddenValue'); assert.deepStrictEqual(testObject.getValue('configurationService.defaultOverridesSetting'), 'overriddenValue');
}); });
function createConfigurationService(configurationDefaults: Record<string, any>): IConfigurationService { function createConfigurationService(configurationDefaults: Record<string, any>): IConfigurationService {

View file

@ -147,7 +147,7 @@ suite('Workspace Configuration', () => {
const actual = configuration2.compare(configuration1); const actual = configuration2.compare(configuration1);
assert.deepEqual(actual, { keys: [], overrides: [] }); assert.deepStrictEqual(actual, { keys: [], overrides: [] });
}); });
test('Test compare different configurations', () => { test('Test compare different configurations', () => {
@ -173,7 +173,7 @@ suite('Workspace Configuration', () => {
const actual = configuration2.compare(configuration1); const actual = configuration2.compare(configuration1);
assert.deepEqual(actual, { keys: ['editor.wordWrap', 'editor.fontSize', '[markdown]', 'window.title', 'workbench.enableTabs', '[typescript]'], overrides: [['markdown', ['editor.lineNumbers', 'editor.wordWrap']], ['typescript', ['editor.insertSpaces']]] }); assert.deepStrictEqual(actual, { keys: ['editor.wordWrap', 'editor.fontSize', '[markdown]', 'window.title', 'workbench.enableTabs', '[typescript]'], overrides: [['markdown', ['editor.lineNumbers', 'editor.wordWrap']], ['typescript', ['editor.insertSpaces']]] });
}); });

View file

@ -186,7 +186,7 @@ suite('Configuration Resolver Service', () => {
// '${workspaceRootFolderName}': '${lineNumber}', // '${workspaceRootFolderName}': '${lineNumber}',
// 'hey ${env:key1} ': '${workspaceRootFolderName}' // 'hey ${env:key1} ': '${workspaceRootFolderName}'
// }; // };
// assert.deepEqual(configurationResolverService!.resolve(workspace, myObject), { // assert.deepStrictEqual(configurationResolverService!.resolve(workspace, myObject), {
// 'workspaceLocation': `${editorService.mockLineNumber}`, // 'workspaceLocation': `${editorService.mockLineNumber}`,
// 'hey Value for key1 ': 'workspaceLocation' // 'hey Value for key1 ': 'workspaceLocation'
// }); // });
@ -360,7 +360,6 @@ suite('Configuration Resolver Service', () => {
}; };
return configurationResolverService!.resolveWithInteractionReplace(undefined, configuration).then(result => { return configurationResolverService!.resolveWithInteractionReplace(undefined, configuration).then(result => {
assert.deepEqual(result, { assert.deepEqual(result, {
'name': 'Attach to Process', 'name': 'Attach to Process',
'type': 'node', 'type': 'node',

View file

@ -58,7 +58,7 @@ suite('DecorationsService', function () {
assert.strictEqual(e.affectsResource(uri), true); assert.strictEqual(e.affectsResource(uri), true);
// sync result // sync result
assert.deepEqual(service.getDecoration(uri, false)!.tooltip, 'T'); assert.deepStrictEqual(service.getDecoration(uri, false)!.tooltip, 'T');
assert.strictEqual(callCounter, 1); assert.strictEqual(callCounter, 1);
}); });
}); });
@ -78,7 +78,7 @@ suite('DecorationsService', function () {
}); });
// trigger -> sync // trigger -> sync
assert.deepEqual(service.getDecoration(uri, false)!.tooltip, 'Z'); assert.deepStrictEqual(service.getDecoration(uri, false)!.tooltip, 'Z');
assert.strictEqual(callCounter, 1); assert.strictEqual(callCounter, 1);
}); });
@ -96,7 +96,7 @@ suite('DecorationsService', function () {
}); });
// trigger -> sync // trigger -> sync
assert.deepEqual(service.getDecoration(uri, false)!.tooltip, 'J'); assert.deepStrictEqual(service.getDecoration(uri, false)!.tooltip, 'J');
assert.strictEqual(callCounter, 1); assert.strictEqual(callCounter, 1);
// un-register -> ensure good event // un-register -> ensure good event
@ -104,7 +104,7 @@ suite('DecorationsService', function () {
let p = new Promise<void>(resolve => { let p = new Promise<void>(resolve => {
service.onDidChangeDecorations(e => { service.onDidChangeDecorations(e => {
assert.strictEqual(e.affectsResource(uri), true); assert.strictEqual(e.affectsResource(uri), true);
assert.deepEqual(service.getDecoration(uri, false), undefined); assert.deepStrictEqual(service.getDecoration(uri, false), undefined);
assert.strictEqual(callCounter, 1); assert.strictEqual(callCounter, 1);
didSeeEvent = true; didSeeEvent = true;
resolve(); resolve();

View file

@ -132,7 +132,7 @@ suite('ExtensionEnablementService Test', () => {
return testObject.setEnablement([aLocalExtension('pub.a')], EnablementState.DisabledGlobally) return testObject.setEnablement([aLocalExtension('pub.a')], EnablementState.DisabledGlobally)
.then(() => { .then(() => {
assert.ok(target.calledOnce); assert.ok(target.calledOnce);
assert.deepEqual((<IExtension>target.args[0][0][0]).identifier, { id: 'pub.a' }); assert.deepStrictEqual((<IExtension>target.args[0][0][0]).identifier, { id: 'pub.a' });
}); });
}); });
@ -249,7 +249,7 @@ suite('ExtensionEnablementService Test', () => {
.then(() => testObject.setEnablement([aLocalExtension('pub.a')], EnablementState.DisabledGlobally)) .then(() => testObject.setEnablement([aLocalExtension('pub.a')], EnablementState.DisabledGlobally))
.then(() => { .then(() => {
assert.ok(target.calledOnce); assert.ok(target.calledOnce);
assert.deepEqual((<IExtension>target.args[0][0][0]).identifier, { id: 'pub.a' }); assert.deepStrictEqual((<IExtension>target.args[0][0][0]).identifier, { id: 'pub.a' });
}); });
}); });
@ -274,7 +274,7 @@ suite('ExtensionEnablementService Test', () => {
.then(() => testObject.setEnablement([aLocalExtension('pub.a')], EnablementState.DisabledWorkspace)) .then(() => testObject.setEnablement([aLocalExtension('pub.a')], EnablementState.DisabledWorkspace))
.then(() => { .then(() => {
assert.ok(target.calledOnce); assert.ok(target.calledOnce);
assert.deepEqual((<IExtension>target.args[0][0][0]).identifier, { id: 'pub.a' }); assert.deepStrictEqual((<IExtension>target.args[0][0][0]).identifier, { id: 'pub.a' });
}); });
}); });
@ -305,7 +305,7 @@ suite('ExtensionEnablementService Test', () => {
.then(() => testObject.setEnablement([aLocalExtension('pub.a')], EnablementState.EnabledGlobally)) .then(() => testObject.setEnablement([aLocalExtension('pub.a')], EnablementState.EnabledGlobally))
.then(() => { .then(() => {
assert.ok(target.calledOnce); assert.ok(target.calledOnce);
assert.deepEqual((<IExtension>target.args[0][0][0]).identifier, { id: 'pub.a' }); assert.deepStrictEqual((<IExtension>target.args[0][0][0]).identifier, { id: 'pub.a' });
}); });
}); });
@ -335,7 +335,7 @@ suite('ExtensionEnablementService Test', () => {
.then(() => testObject.setEnablement([aLocalExtension('pub.b')], EnablementState.EnabledWorkspace)) .then(() => testObject.setEnablement([aLocalExtension('pub.b')], EnablementState.EnabledWorkspace))
.then(() => { .then(() => {
assert.ok(target.calledOnce); assert.ok(target.calledOnce);
assert.deepEqual((<IExtension>target.args[0][0][0]).identifier, { id: 'pub.b' }); assert.deepStrictEqual((<IExtension>target.args[0][0][0]).identifier, { id: 'pub.b' });
}); });
}); });
@ -470,7 +470,7 @@ suite('ExtensionEnablementService Test', () => {
}); });
testObject = new TestExtensionEnablementService(instantiationService); testObject = new TestExtensionEnablementService(instantiationService);
assert.ok(!testObject.isEnabled(extension)); assert.ok(!testObject.isEnabled(extension));
assert.deepEqual(testObject.getEnablementState(extension), EnablementState.DisabledByEnvironment); assert.deepStrictEqual(testObject.getEnablementState(extension), EnablementState.DisabledByEnvironment);
}); });
test('test local workspace extension is disabled by kind', async () => { test('test local workspace extension is disabled by kind', async () => {
@ -478,7 +478,7 @@ suite('ExtensionEnablementService Test', () => {
const localWorkspaceExtension = aLocalExtension2('pub.a', { extensionKind: ['workspace'] }, { location: URI.file(`pub.a`) }); const localWorkspaceExtension = aLocalExtension2('pub.a', { extensionKind: ['workspace'] }, { location: URI.file(`pub.a`) });
testObject = new TestExtensionEnablementService(instantiationService); testObject = new TestExtensionEnablementService(instantiationService);
assert.ok(!testObject.isEnabled(localWorkspaceExtension)); assert.ok(!testObject.isEnabled(localWorkspaceExtension));
assert.deepEqual(testObject.getEnablementState(localWorkspaceExtension), EnablementState.DisabledByExtensionKind); assert.deepStrictEqual(testObject.getEnablementState(localWorkspaceExtension), EnablementState.DisabledByExtensionKind);
}); });
test('test local workspace + ui extension is enabled by kind', async () => { test('test local workspace + ui extension is enabled by kind', async () => {
@ -486,7 +486,7 @@ suite('ExtensionEnablementService Test', () => {
const localWorkspaceExtension = aLocalExtension2('pub.a', { extensionKind: ['workspace', 'ui'] }, { location: URI.file(`pub.a`) }); const localWorkspaceExtension = aLocalExtension2('pub.a', { extensionKind: ['workspace', 'ui'] }, { location: URI.file(`pub.a`) });
testObject = new TestExtensionEnablementService(instantiationService); testObject = new TestExtensionEnablementService(instantiationService);
assert.ok(testObject.isEnabled(localWorkspaceExtension)); assert.ok(testObject.isEnabled(localWorkspaceExtension));
assert.deepEqual(testObject.getEnablementState(localWorkspaceExtension), EnablementState.EnabledGlobally); assert.deepStrictEqual(testObject.getEnablementState(localWorkspaceExtension), EnablementState.EnabledGlobally);
}); });
test('test local ui extension is not disabled by kind', async () => { test('test local ui extension is not disabled by kind', async () => {
@ -494,7 +494,7 @@ suite('ExtensionEnablementService Test', () => {
const localWorkspaceExtension = aLocalExtension2('pub.a', { extensionKind: ['ui'] }, { location: URI.file(`pub.a`) }); const localWorkspaceExtension = aLocalExtension2('pub.a', { extensionKind: ['ui'] }, { location: URI.file(`pub.a`) });
testObject = new TestExtensionEnablementService(instantiationService); testObject = new TestExtensionEnablementService(instantiationService);
assert.ok(testObject.isEnabled(localWorkspaceExtension)); assert.ok(testObject.isEnabled(localWorkspaceExtension));
assert.deepEqual(testObject.getEnablementState(localWorkspaceExtension), EnablementState.EnabledGlobally); assert.deepStrictEqual(testObject.getEnablementState(localWorkspaceExtension), EnablementState.EnabledGlobally);
}); });
test('test canChangeEnablement return false when the local workspace extension is disabled by kind', () => { test('test canChangeEnablement return false when the local workspace extension is disabled by kind', () => {
@ -516,7 +516,7 @@ suite('ExtensionEnablementService Test', () => {
const localWorkspaceExtension = aLocalExtension2('pub.a', { extensionKind: ['ui'] }, { location: URI.file(`pub.a`).with({ scheme: Schemas.vscodeRemote }) }); const localWorkspaceExtension = aLocalExtension2('pub.a', { extensionKind: ['ui'] }, { location: URI.file(`pub.a`).with({ scheme: Schemas.vscodeRemote }) });
testObject = new TestExtensionEnablementService(instantiationService); testObject = new TestExtensionEnablementService(instantiationService);
assert.ok(!testObject.isEnabled(localWorkspaceExtension)); assert.ok(!testObject.isEnabled(localWorkspaceExtension));
assert.deepEqual(testObject.getEnablementState(localWorkspaceExtension), EnablementState.DisabledByExtensionKind); assert.deepStrictEqual(testObject.getEnablementState(localWorkspaceExtension), EnablementState.DisabledByExtensionKind);
}); });
test('test remote ui+workspace extension is disabled by kind', async () => { test('test remote ui+workspace extension is disabled by kind', async () => {
@ -524,7 +524,7 @@ suite('ExtensionEnablementService Test', () => {
const localWorkspaceExtension = aLocalExtension2('pub.a', { extensionKind: ['ui', 'workspace'] }, { location: URI.file(`pub.a`).with({ scheme: Schemas.vscodeRemote }) }); const localWorkspaceExtension = aLocalExtension2('pub.a', { extensionKind: ['ui', 'workspace'] }, { location: URI.file(`pub.a`).with({ scheme: Schemas.vscodeRemote }) });
testObject = new TestExtensionEnablementService(instantiationService); testObject = new TestExtensionEnablementService(instantiationService);
assert.ok(testObject.isEnabled(localWorkspaceExtension)); assert.ok(testObject.isEnabled(localWorkspaceExtension));
assert.deepEqual(testObject.getEnablementState(localWorkspaceExtension), EnablementState.EnabledGlobally); assert.deepStrictEqual(testObject.getEnablementState(localWorkspaceExtension), EnablementState.EnabledGlobally);
}); });
test('test remote ui extension is disabled by kind when there is no local server', async () => { test('test remote ui extension is disabled by kind when there is no local server', async () => {
@ -532,7 +532,7 @@ suite('ExtensionEnablementService Test', () => {
const localWorkspaceExtension = aLocalExtension2('pub.a', { extensionKind: ['ui'] }, { location: URI.file(`pub.a`).with({ scheme: Schemas.vscodeRemote }) }); const localWorkspaceExtension = aLocalExtension2('pub.a', { extensionKind: ['ui'] }, { location: URI.file(`pub.a`).with({ scheme: Schemas.vscodeRemote }) });
testObject = new TestExtensionEnablementService(instantiationService); testObject = new TestExtensionEnablementService(instantiationService);
assert.ok(!testObject.isEnabled(localWorkspaceExtension)); assert.ok(!testObject.isEnabled(localWorkspaceExtension));
assert.deepEqual(testObject.getEnablementState(localWorkspaceExtension), EnablementState.DisabledByExtensionKind); assert.deepStrictEqual(testObject.getEnablementState(localWorkspaceExtension), EnablementState.DisabledByExtensionKind);
}); });
test('test remote workspace extension is not disabled by kind', async () => { test('test remote workspace extension is not disabled by kind', async () => {
@ -540,7 +540,7 @@ suite('ExtensionEnablementService Test', () => {
const localWorkspaceExtension = aLocalExtension2('pub.a', { extensionKind: ['workspace'] }, { location: URI.file(`pub.a`).with({ scheme: Schemas.vscodeRemote }) }); const localWorkspaceExtension = aLocalExtension2('pub.a', { extensionKind: ['workspace'] }, { location: URI.file(`pub.a`).with({ scheme: Schemas.vscodeRemote }) });
testObject = new TestExtensionEnablementService(instantiationService); testObject = new TestExtensionEnablementService(instantiationService);
assert.ok(testObject.isEnabled(localWorkspaceExtension)); assert.ok(testObject.isEnabled(localWorkspaceExtension));
assert.deepEqual(testObject.getEnablementState(localWorkspaceExtension), EnablementState.EnabledGlobally); assert.deepStrictEqual(testObject.getEnablementState(localWorkspaceExtension), EnablementState.EnabledGlobally);
}); });
test('test canChangeEnablement return false when the remote ui extension is disabled by kind', () => { test('test canChangeEnablement return false when the remote ui extension is disabled by kind', () => {
@ -563,7 +563,7 @@ suite('ExtensionEnablementService Test', () => {
(<TestConfigurationService>instantiationService.get(IConfigurationService)).setUserConfiguration('extensions', { webWorker: false }); (<TestConfigurationService>instantiationService.get(IConfigurationService)).setUserConfiguration('extensions', { webWorker: false });
testObject = new TestExtensionEnablementService(instantiationService); testObject = new TestExtensionEnablementService(instantiationService);
assert.strictEqual(testObject.isEnabled(localWorkspaceExtension), false); assert.strictEqual(testObject.isEnabled(localWorkspaceExtension), false);
assert.deepEqual(testObject.getEnablementState(localWorkspaceExtension), EnablementState.DisabledByExtensionKind); assert.deepStrictEqual(testObject.getEnablementState(localWorkspaceExtension), EnablementState.DisabledByExtensionKind);
}); });
test('test web extension on local server is not disabled by kind when web worker is enabled', async () => { test('test web extension on local server is not disabled by kind when web worker is enabled', async () => {
@ -572,7 +572,7 @@ suite('ExtensionEnablementService Test', () => {
(<TestConfigurationService>instantiationService.get(IConfigurationService)).setUserConfiguration('extensions', { webWorker: true }); (<TestConfigurationService>instantiationService.get(IConfigurationService)).setUserConfiguration('extensions', { webWorker: true });
testObject = new TestExtensionEnablementService(instantiationService); testObject = new TestExtensionEnablementService(instantiationService);
assert.strictEqual(testObject.isEnabled(localWorkspaceExtension), true); assert.strictEqual(testObject.isEnabled(localWorkspaceExtension), true);
assert.deepEqual(testObject.getEnablementState(localWorkspaceExtension), EnablementState.EnabledGlobally); assert.deepStrictEqual(testObject.getEnablementState(localWorkspaceExtension), EnablementState.EnabledGlobally);
}); });
test('test web extension on remote server is disabled by kind when web worker is not enabled', async () => { test('test web extension on remote server is disabled by kind when web worker is not enabled', async () => {
@ -581,7 +581,7 @@ suite('ExtensionEnablementService Test', () => {
(<TestConfigurationService>instantiationService.get(IConfigurationService)).setUserConfiguration('extensions', { webWorker: false }); (<TestConfigurationService>instantiationService.get(IConfigurationService)).setUserConfiguration('extensions', { webWorker: false });
testObject = new TestExtensionEnablementService(instantiationService); testObject = new TestExtensionEnablementService(instantiationService);
assert.strictEqual(testObject.isEnabled(localWorkspaceExtension), false); assert.strictEqual(testObject.isEnabled(localWorkspaceExtension), false);
assert.deepEqual(testObject.getEnablementState(localWorkspaceExtension), EnablementState.DisabledByExtensionKind); assert.deepStrictEqual(testObject.getEnablementState(localWorkspaceExtension), EnablementState.DisabledByExtensionKind);
}); });
test('test web extension on remote server is disabled by kind when web worker is enabled', async () => { test('test web extension on remote server is disabled by kind when web worker is enabled', async () => {
@ -590,7 +590,7 @@ suite('ExtensionEnablementService Test', () => {
(<TestConfigurationService>instantiationService.get(IConfigurationService)).setUserConfiguration('extensions', { webWorker: true }); (<TestConfigurationService>instantiationService.get(IConfigurationService)).setUserConfiguration('extensions', { webWorker: true });
testObject = new TestExtensionEnablementService(instantiationService); testObject = new TestExtensionEnablementService(instantiationService);
assert.strictEqual(testObject.isEnabled(localWorkspaceExtension), false); assert.strictEqual(testObject.isEnabled(localWorkspaceExtension), false);
assert.deepEqual(testObject.getEnablementState(localWorkspaceExtension), EnablementState.DisabledByExtensionKind); assert.deepStrictEqual(testObject.getEnablementState(localWorkspaceExtension), EnablementState.DisabledByExtensionKind);
}); });
test('test web extension on web server is not disabled by kind', async () => { test('test web extension on web server is not disabled by kind', async () => {
@ -598,7 +598,7 @@ suite('ExtensionEnablementService Test', () => {
const webExtension = aLocalExtension2('pub.a', { extensionKind: ['web'] }, { location: URI.file(`pub.a`).with({ scheme: 'web' }) }); const webExtension = aLocalExtension2('pub.a', { extensionKind: ['web'] }, { location: URI.file(`pub.a`).with({ scheme: 'web' }) });
testObject = new TestExtensionEnablementService(instantiationService); testObject = new TestExtensionEnablementService(instantiationService);
assert.strictEqual(testObject.isEnabled(webExtension), true); assert.strictEqual(testObject.isEnabled(webExtension), true);
assert.deepEqual(testObject.getEnablementState(webExtension), EnablementState.EnabledGlobally); assert.deepStrictEqual(testObject.getEnablementState(webExtension), EnablementState.EnabledGlobally);
}); });
}); });

View file

@ -164,59 +164,59 @@ suite('KeybindingsEditing', () => {
await fileService.writeFile(environmentService.keybindingsResource, VSBuffer.fromString('')); await fileService.writeFile(environmentService.keybindingsResource, VSBuffer.fromString(''));
const expected: IUserFriendlyKeybinding[] = [{ key: 'alt+c', command: 'a' }, { key: 'escape', command: '-a' }]; const expected: IUserFriendlyKeybinding[] = [{ key: 'alt+c', command: 'a' }, { key: 'escape', command: '-a' }];
await testObject.editKeybinding(aResolvedKeybindingItem({ firstPart: { keyCode: KeyCode.Escape }, command: 'a' }), 'alt+c', undefined); await testObject.editKeybinding(aResolvedKeybindingItem({ firstPart: { keyCode: KeyCode.Escape }, command: 'a' }), 'alt+c', undefined);
assert.deepEqual(await getUserKeybindings(), expected); assert.deepStrictEqual(await getUserKeybindings(), expected);
}); });
test('edit a default keybinding to an empty array', async () => { test('edit a default keybinding to an empty array', async () => {
await writeToKeybindingsFile(); await writeToKeybindingsFile();
const expected: IUserFriendlyKeybinding[] = [{ key: 'alt+c', command: 'a' }, { key: 'escape', command: '-a' }]; const expected: IUserFriendlyKeybinding[] = [{ key: 'alt+c', command: 'a' }, { key: 'escape', command: '-a' }];
await testObject.editKeybinding(aResolvedKeybindingItem({ firstPart: { keyCode: KeyCode.Escape }, command: 'a' }), 'alt+c', undefined); await testObject.editKeybinding(aResolvedKeybindingItem({ firstPart: { keyCode: KeyCode.Escape }, command: 'a' }), 'alt+c', undefined);
return assert.deepEqual(await getUserKeybindings(), expected); return assert.deepStrictEqual(await getUserKeybindings(), expected);
}); });
test('edit a default keybinding in an existing array', async () => { test('edit a default keybinding in an existing array', async () => {
await writeToKeybindingsFile({ command: 'b', key: 'shift+c' }); await writeToKeybindingsFile({ command: 'b', key: 'shift+c' });
const expected: IUserFriendlyKeybinding[] = [{ key: 'shift+c', command: 'b' }, { key: 'alt+c', command: 'a' }, { key: 'escape', command: '-a' }]; const expected: IUserFriendlyKeybinding[] = [{ key: 'shift+c', command: 'b' }, { key: 'alt+c', command: 'a' }, { key: 'escape', command: '-a' }];
await testObject.editKeybinding(aResolvedKeybindingItem({ firstPart: { keyCode: KeyCode.Escape }, command: 'a' }), 'alt+c', undefined); await testObject.editKeybinding(aResolvedKeybindingItem({ firstPart: { keyCode: KeyCode.Escape }, command: 'a' }), 'alt+c', undefined);
return assert.deepEqual(await getUserKeybindings(), expected); return assert.deepStrictEqual(await getUserKeybindings(), expected);
}); });
test('add another keybinding', async () => { test('add another keybinding', async () => {
const expected: IUserFriendlyKeybinding[] = [{ key: 'alt+c', command: 'a' }]; const expected: IUserFriendlyKeybinding[] = [{ key: 'alt+c', command: 'a' }];
await testObject.addKeybinding(aResolvedKeybindingItem({ firstPart: { keyCode: KeyCode.Escape }, command: 'a' }), 'alt+c', undefined); await testObject.addKeybinding(aResolvedKeybindingItem({ firstPart: { keyCode: KeyCode.Escape }, command: 'a' }), 'alt+c', undefined);
return assert.deepEqual(await getUserKeybindings(), expected); return assert.deepStrictEqual(await getUserKeybindings(), expected);
}); });
test('add a new default keybinding', async () => { test('add a new default keybinding', async () => {
const expected: IUserFriendlyKeybinding[] = [{ key: 'alt+c', command: 'a' }]; const expected: IUserFriendlyKeybinding[] = [{ key: 'alt+c', command: 'a' }];
await testObject.addKeybinding(aResolvedKeybindingItem({ command: 'a' }), 'alt+c', undefined); await testObject.addKeybinding(aResolvedKeybindingItem({ command: 'a' }), 'alt+c', undefined);
return assert.deepEqual(await getUserKeybindings(), expected); return assert.deepStrictEqual(await getUserKeybindings(), expected);
}); });
test('add a new default keybinding using edit', async () => { test('add a new default keybinding using edit', async () => {
const expected: IUserFriendlyKeybinding[] = [{ key: 'alt+c', command: 'a' }]; const expected: IUserFriendlyKeybinding[] = [{ key: 'alt+c', command: 'a' }];
await testObject.editKeybinding(aResolvedKeybindingItem({ command: 'a' }), 'alt+c', undefined); await testObject.editKeybinding(aResolvedKeybindingItem({ command: 'a' }), 'alt+c', undefined);
assert.deepEqual(await getUserKeybindings(), expected); assert.deepStrictEqual(await getUserKeybindings(), expected);
}); });
test('edit an user keybinding', async () => { test('edit an user keybinding', async () => {
await writeToKeybindingsFile({ key: 'escape', command: 'b' }); await writeToKeybindingsFile({ key: 'escape', command: 'b' });
const expected: IUserFriendlyKeybinding[] = [{ key: 'alt+c', command: 'b' }]; const expected: IUserFriendlyKeybinding[] = [{ key: 'alt+c', command: 'b' }];
await testObject.editKeybinding(aResolvedKeybindingItem({ firstPart: { keyCode: KeyCode.Escape }, command: 'b', isDefault: false }), 'alt+c', undefined); await testObject.editKeybinding(aResolvedKeybindingItem({ firstPart: { keyCode: KeyCode.Escape }, command: 'b', isDefault: false }), 'alt+c', undefined);
assert.deepEqual(await getUserKeybindings(), expected); assert.deepStrictEqual(await getUserKeybindings(), expected);
}); });
test('edit an user keybinding with more than one element', async () => { test('edit an user keybinding with more than one element', async () => {
await writeToKeybindingsFile({ key: 'escape', command: 'b' }, { key: 'alt+shift+g', command: 'c' }); await writeToKeybindingsFile({ key: 'escape', command: 'b' }, { key: 'alt+shift+g', command: 'c' });
const expected: IUserFriendlyKeybinding[] = [{ key: 'alt+c', command: 'b' }, { key: 'alt+shift+g', command: 'c' }]; const expected: IUserFriendlyKeybinding[] = [{ key: 'alt+c', command: 'b' }, { key: 'alt+shift+g', command: 'c' }];
await testObject.editKeybinding(aResolvedKeybindingItem({ firstPart: { keyCode: KeyCode.Escape }, command: 'b', isDefault: false }), 'alt+c', undefined); await testObject.editKeybinding(aResolvedKeybindingItem({ firstPart: { keyCode: KeyCode.Escape }, command: 'b', isDefault: false }), 'alt+c', undefined);
assert.deepEqual(await getUserKeybindings(), expected); assert.deepStrictEqual(await getUserKeybindings(), expected);
}); });
test('remove a default keybinding', async () => { test('remove a default keybinding', async () => {
const expected: IUserFriendlyKeybinding[] = [{ key: 'alt+c', command: '-a' }]; const expected: IUserFriendlyKeybinding[] = [{ key: 'alt+c', command: '-a' }];
await testObject.removeKeybinding(aResolvedKeybindingItem({ command: 'a', firstPart: { keyCode: KeyCode.KEY_C, modifiers: { altKey: true } } })); await testObject.removeKeybinding(aResolvedKeybindingItem({ command: 'a', firstPart: { keyCode: KeyCode.KEY_C, modifiers: { altKey: true } } }));
assert.deepEqual(await getUserKeybindings(), expected); assert.deepStrictEqual(await getUserKeybindings(), expected);
}); });
test('remove a default keybinding should not ad duplicate entries', async () => { test('remove a default keybinding should not ad duplicate entries', async () => {
@ -226,25 +226,25 @@ suite('KeybindingsEditing', () => {
await testObject.removeKeybinding(aResolvedKeybindingItem({ command: 'a', firstPart: { keyCode: KeyCode.KEY_C, modifiers: { altKey: true } } })); await testObject.removeKeybinding(aResolvedKeybindingItem({ command: 'a', firstPart: { keyCode: KeyCode.KEY_C, modifiers: { altKey: true } } }));
await testObject.removeKeybinding(aResolvedKeybindingItem({ command: 'a', firstPart: { keyCode: KeyCode.KEY_C, modifiers: { altKey: true } } })); await testObject.removeKeybinding(aResolvedKeybindingItem({ command: 'a', firstPart: { keyCode: KeyCode.KEY_C, modifiers: { altKey: true } } }));
await testObject.removeKeybinding(aResolvedKeybindingItem({ command: 'a', firstPart: { keyCode: KeyCode.KEY_C, modifiers: { altKey: true } } })); await testObject.removeKeybinding(aResolvedKeybindingItem({ command: 'a', firstPart: { keyCode: KeyCode.KEY_C, modifiers: { altKey: true } } }));
assert.deepEqual(await getUserKeybindings(), expected); assert.deepStrictEqual(await getUserKeybindings(), expected);
}); });
test('remove a user keybinding', async () => { test('remove a user keybinding', async () => {
await writeToKeybindingsFile({ key: 'alt+c', command: 'b' }); await writeToKeybindingsFile({ key: 'alt+c', command: 'b' });
await testObject.removeKeybinding(aResolvedKeybindingItem({ command: 'b', firstPart: { keyCode: KeyCode.KEY_C, modifiers: { altKey: true } }, isDefault: false })); await testObject.removeKeybinding(aResolvedKeybindingItem({ command: 'b', firstPart: { keyCode: KeyCode.KEY_C, modifiers: { altKey: true } }, isDefault: false }));
assert.deepEqual(await getUserKeybindings(), []); assert.deepStrictEqual(await getUserKeybindings(), []);
}); });
test('reset an edited keybinding', async () => { test('reset an edited keybinding', async () => {
await writeToKeybindingsFile({ key: 'alt+c', command: 'b' }); await writeToKeybindingsFile({ key: 'alt+c', command: 'b' });
await testObject.resetKeybinding(aResolvedKeybindingItem({ command: 'b', firstPart: { keyCode: KeyCode.KEY_C, modifiers: { altKey: true } }, isDefault: false })); await testObject.resetKeybinding(aResolvedKeybindingItem({ command: 'b', firstPart: { keyCode: KeyCode.KEY_C, modifiers: { altKey: true } }, isDefault: false }));
assert.deepEqual(await getUserKeybindings(), []); assert.deepStrictEqual(await getUserKeybindings(), []);
}); });
test('reset a removed keybinding', async () => { test('reset a removed keybinding', async () => {
await writeToKeybindingsFile({ key: 'alt+c', command: '-b' }); await writeToKeybindingsFile({ key: 'alt+c', command: '-b' });
await testObject.resetKeybinding(aResolvedKeybindingItem({ command: 'b', isDefault: false })); await testObject.resetKeybinding(aResolvedKeybindingItem({ command: 'b', isDefault: false }));
assert.deepEqual(await getUserKeybindings(), []); assert.deepStrictEqual(await getUserKeybindings(), []);
}); });
test('reset multiple removed keybindings', async () => { test('reset multiple removed keybindings', async () => {
@ -252,42 +252,42 @@ suite('KeybindingsEditing', () => {
await writeToKeybindingsFile({ key: 'alt+shift+c', command: '-b' }); await writeToKeybindingsFile({ key: 'alt+shift+c', command: '-b' });
await writeToKeybindingsFile({ key: 'escape', command: '-b' }); await writeToKeybindingsFile({ key: 'escape', command: '-b' });
await testObject.resetKeybinding(aResolvedKeybindingItem({ command: 'b', isDefault: false })); await testObject.resetKeybinding(aResolvedKeybindingItem({ command: 'b', isDefault: false }));
assert.deepEqual(await getUserKeybindings(), []); assert.deepStrictEqual(await getUserKeybindings(), []);
}); });
test('add a new keybinding to unassigned keybinding', async () => { test('add a new keybinding to unassigned keybinding', async () => {
await writeToKeybindingsFile({ key: 'alt+c', command: '-a' }); await writeToKeybindingsFile({ key: 'alt+c', command: '-a' });
const expected: IUserFriendlyKeybinding[] = [{ key: 'alt+c', command: '-a' }, { key: 'shift+alt+c', command: 'a' }]; const expected: IUserFriendlyKeybinding[] = [{ key: 'alt+c', command: '-a' }, { key: 'shift+alt+c', command: 'a' }];
await testObject.editKeybinding(aResolvedKeybindingItem({ command: 'a', isDefault: false }), 'shift+alt+c', undefined); await testObject.editKeybinding(aResolvedKeybindingItem({ command: 'a', isDefault: false }), 'shift+alt+c', undefined);
assert.deepEqual(await getUserKeybindings(), expected); assert.deepStrictEqual(await getUserKeybindings(), expected);
}); });
test('add when expression', async () => { test('add when expression', async () => {
await writeToKeybindingsFile({ key: 'alt+c', command: '-a' }); await writeToKeybindingsFile({ key: 'alt+c', command: '-a' });
const expected: IUserFriendlyKeybinding[] = [{ key: 'alt+c', command: '-a' }, { key: 'shift+alt+c', command: 'a', when: 'editorTextFocus' }]; const expected: IUserFriendlyKeybinding[] = [{ key: 'alt+c', command: '-a' }, { key: 'shift+alt+c', command: 'a', when: 'editorTextFocus' }];
await testObject.editKeybinding(aResolvedKeybindingItem({ command: 'a', isDefault: false }), 'shift+alt+c', 'editorTextFocus'); await testObject.editKeybinding(aResolvedKeybindingItem({ command: 'a', isDefault: false }), 'shift+alt+c', 'editorTextFocus');
assert.deepEqual(await getUserKeybindings(), expected); assert.deepStrictEqual(await getUserKeybindings(), expected);
}); });
test('update command and when expression', async () => { test('update command and when expression', async () => {
await writeToKeybindingsFile({ key: 'alt+c', command: '-a', when: 'editorTextFocus && !editorReadonly' }); await writeToKeybindingsFile({ key: 'alt+c', command: '-a', when: 'editorTextFocus && !editorReadonly' });
const expected: IUserFriendlyKeybinding[] = [{ key: 'alt+c', command: '-a', when: 'editorTextFocus && !editorReadonly' }, { key: 'shift+alt+c', command: 'a', when: 'editorTextFocus' }]; const expected: IUserFriendlyKeybinding[] = [{ key: 'alt+c', command: '-a', when: 'editorTextFocus && !editorReadonly' }, { key: 'shift+alt+c', command: 'a', when: 'editorTextFocus' }];
await testObject.editKeybinding(aResolvedKeybindingItem({ command: 'a', isDefault: false }), 'shift+alt+c', 'editorTextFocus'); await testObject.editKeybinding(aResolvedKeybindingItem({ command: 'a', isDefault: false }), 'shift+alt+c', 'editorTextFocus');
assert.deepEqual(await getUserKeybindings(), expected); assert.deepStrictEqual(await getUserKeybindings(), expected);
}); });
test('update when expression', async () => { test('update when expression', async () => {
await writeToKeybindingsFile({ key: 'alt+c', command: '-a', when: 'editorTextFocus && !editorReadonly' }, { key: 'shift+alt+c', command: 'a', when: 'editorTextFocus && !editorReadonly' }); await writeToKeybindingsFile({ key: 'alt+c', command: '-a', when: 'editorTextFocus && !editorReadonly' }, { key: 'shift+alt+c', command: 'a', when: 'editorTextFocus && !editorReadonly' });
const expected: IUserFriendlyKeybinding[] = [{ key: 'alt+c', command: '-a', when: 'editorTextFocus && !editorReadonly' }, { key: 'shift+alt+c', command: 'a', when: 'editorTextFocus' }]; const expected: IUserFriendlyKeybinding[] = [{ key: 'alt+c', command: '-a', when: 'editorTextFocus && !editorReadonly' }, { key: 'shift+alt+c', command: 'a', when: 'editorTextFocus' }];
await testObject.editKeybinding(aResolvedKeybindingItem({ command: 'a', isDefault: false, when: 'editorTextFocus && !editorReadonly' }), 'shift+alt+c', 'editorTextFocus'); await testObject.editKeybinding(aResolvedKeybindingItem({ command: 'a', isDefault: false, when: 'editorTextFocus && !editorReadonly' }), 'shift+alt+c', 'editorTextFocus');
assert.deepEqual(await getUserKeybindings(), expected); assert.deepStrictEqual(await getUserKeybindings(), expected);
}); });
test('remove when expression', async () => { test('remove when expression', async () => {
await writeToKeybindingsFile({ key: 'alt+c', command: '-a', when: 'editorTextFocus && !editorReadonly' }); await writeToKeybindingsFile({ key: 'alt+c', command: '-a', when: 'editorTextFocus && !editorReadonly' });
const expected: IUserFriendlyKeybinding[] = [{ key: 'alt+c', command: '-a', when: 'editorTextFocus && !editorReadonly' }, { key: 'shift+alt+c', command: 'a' }]; const expected: IUserFriendlyKeybinding[] = [{ key: 'alt+c', command: '-a', when: 'editorTextFocus && !editorReadonly' }, { key: 'shift+alt+c', command: 'a' }];
await testObject.editKeybinding(aResolvedKeybindingItem({ command: 'a', isDefault: false }), 'shift+alt+c', undefined); await testObject.editKeybinding(aResolvedKeybindingItem({ command: 'a', isDefault: false }), 'shift+alt+c', undefined);
assert.deepEqual(await getUserKeybindings(), expected); assert.deepStrictEqual(await getUserKeybindings(), expected);
}); });
async function writeToKeybindingsFile(...keybindings: IUserFriendlyKeybinding[]): Promise<void> { async function writeToKeybindingsFile(...keybindings: IUserFriendlyKeybinding[]): Promise<void> {

View file

@ -271,7 +271,7 @@ suite('KeybindingsEditorModel', () => {
await testObject.resolve(new Map<string, string>()); await testObject.resolve(new Map<string, string>());
const actual = testObject.fetch(`@command:${command}`); const actual = testObject.fetch(`@command:${command}`);
assert.strictEqual(actual.length, 1); assert.strictEqual(actual.length, 1);
assert.deepEqual(actual[0].keybindingItem.command, command); assert.deepStrictEqual(actual[0].keybindingItem.command, command);
}); });
test('filter by command prefix with same commands', async () => { test('filter by command prefix with same commands', async () => {
@ -282,8 +282,8 @@ suite('KeybindingsEditorModel', () => {
await testObject.resolve(new Map<string, string>()); await testObject.resolve(new Map<string, string>());
const actual = testObject.fetch(`@command:${command}`); const actual = testObject.fetch(`@command:${command}`);
assert.strictEqual(actual.length, 2); assert.strictEqual(actual.length, 2);
assert.deepEqual(actual[0].keybindingItem.command, command); assert.deepStrictEqual(actual[0].keybindingItem.command, command);
assert.deepEqual(actual[1].keybindingItem.command, command); assert.deepStrictEqual(actual[1].keybindingItem.command, command);
}); });
test('filter by when context', async () => { test('filter by when context', async () => {
@ -306,8 +306,8 @@ suite('KeybindingsEditorModel', () => {
await testObject.resolve(new Map<string, string>()); await testObject.resolve(new Map<string, string>());
const actual = testObject.fetch('cmd').filter(element => element.keybindingItem.command === command); const actual = testObject.fetch('cmd').filter(element => element.keybindingItem.command === command);
assert.strictEqual(1, actual.length); assert.strictEqual(1, actual.length);
assert.deepEqual(actual[0].keybindingMatches!.firstPart, { metaKey: true }); assert.deepStrictEqual(actual[0].keybindingMatches!.firstPart, { metaKey: true });
assert.deepEqual(actual[0].keybindingMatches!.chordPart, {}); assert.deepStrictEqual(actual[0].keybindingMatches!.chordPart, {});
}); });
test('filter by meta key', async () => { test('filter by meta key', async () => {
@ -320,8 +320,8 @@ suite('KeybindingsEditorModel', () => {
await testObject.resolve(new Map<string, string>()); await testObject.resolve(new Map<string, string>());
const actual = testObject.fetch('meta').filter(element => element.keybindingItem.command === command); const actual = testObject.fetch('meta').filter(element => element.keybindingItem.command === command);
assert.strictEqual(1, actual.length); assert.strictEqual(1, actual.length);
assert.deepEqual(actual[0].keybindingMatches!.firstPart, { metaKey: true }); assert.deepStrictEqual(actual[0].keybindingMatches!.firstPart, { metaKey: true });
assert.deepEqual(actual[0].keybindingMatches!.chordPart, {}); assert.deepStrictEqual(actual[0].keybindingMatches!.chordPart, {});
}); });
test('filter by command key', async () => { test('filter by command key', async () => {
@ -334,8 +334,8 @@ suite('KeybindingsEditorModel', () => {
await testObject.resolve(new Map<string, string>()); await testObject.resolve(new Map<string, string>());
const actual = testObject.fetch('command').filter(element => element.keybindingItem.command === command); const actual = testObject.fetch('command').filter(element => element.keybindingItem.command === command);
assert.strictEqual(1, actual.length); assert.strictEqual(1, actual.length);
assert.deepEqual(actual[0].keybindingMatches!.firstPart, { metaKey: true }); assert.deepStrictEqual(actual[0].keybindingMatches!.firstPart, { metaKey: true });
assert.deepEqual(actual[0].keybindingMatches!.chordPart, {}); assert.deepStrictEqual(actual[0].keybindingMatches!.chordPart, {});
}); });
test('filter by windows key', async () => { test('filter by windows key', async () => {
@ -348,8 +348,8 @@ suite('KeybindingsEditorModel', () => {
await testObject.resolve(new Map<string, string>()); await testObject.resolve(new Map<string, string>());
const actual = testObject.fetch('windows').filter(element => element.keybindingItem.command === command); const actual = testObject.fetch('windows').filter(element => element.keybindingItem.command === command);
assert.strictEqual(1, actual.length); assert.strictEqual(1, actual.length);
assert.deepEqual(actual[0].keybindingMatches!.firstPart, { metaKey: true }); assert.deepStrictEqual(actual[0].keybindingMatches!.firstPart, { metaKey: true });
assert.deepEqual(actual[0].keybindingMatches!.chordPart, {}); assert.deepStrictEqual(actual[0].keybindingMatches!.chordPart, {});
}); });
test('filter by alt key', async () => { test('filter by alt key', async () => {
@ -360,8 +360,8 @@ suite('KeybindingsEditorModel', () => {
await testObject.resolve(new Map<string, string>()); await testObject.resolve(new Map<string, string>());
const actual = testObject.fetch('alt').filter(element => element.keybindingItem.command === command); const actual = testObject.fetch('alt').filter(element => element.keybindingItem.command === command);
assert.strictEqual(1, actual.length); assert.strictEqual(1, actual.length);
assert.deepEqual(actual[0].keybindingMatches!.firstPart, { altKey: true }); assert.deepStrictEqual(actual[0].keybindingMatches!.firstPart, { altKey: true });
assert.deepEqual(actual[0].keybindingMatches!.chordPart, {}); assert.deepStrictEqual(actual[0].keybindingMatches!.chordPart, {});
}); });
test('filter by option key', async () => { test('filter by option key', async () => {
@ -372,8 +372,8 @@ suite('KeybindingsEditorModel', () => {
await testObject.resolve(new Map<string, string>()); await testObject.resolve(new Map<string, string>());
const actual = testObject.fetch('option').filter(element => element.keybindingItem.command === command); const actual = testObject.fetch('option').filter(element => element.keybindingItem.command === command);
assert.strictEqual(1, actual.length); assert.strictEqual(1, actual.length);
assert.deepEqual(actual[0].keybindingMatches!.firstPart, { altKey: true }); assert.deepStrictEqual(actual[0].keybindingMatches!.firstPart, { altKey: true });
assert.deepEqual(actual[0].keybindingMatches!.chordPart, {}); assert.deepStrictEqual(actual[0].keybindingMatches!.chordPart, {});
}); });
test('filter by ctrl key', async () => { test('filter by ctrl key', async () => {
@ -384,8 +384,8 @@ suite('KeybindingsEditorModel', () => {
await testObject.resolve(new Map<string, string>()); await testObject.resolve(new Map<string, string>());
const actual = testObject.fetch('ctrl').filter(element => element.keybindingItem.command === command); const actual = testObject.fetch('ctrl').filter(element => element.keybindingItem.command === command);
assert.strictEqual(1, actual.length); assert.strictEqual(1, actual.length);
assert.deepEqual(actual[0].keybindingMatches!.firstPart, { ctrlKey: true }); assert.deepStrictEqual(actual[0].keybindingMatches!.firstPart, { ctrlKey: true });
assert.deepEqual(actual[0].keybindingMatches!.chordPart, {}); assert.deepStrictEqual(actual[0].keybindingMatches!.chordPart, {});
}); });
test('filter by control key', async () => { test('filter by control key', async () => {
@ -396,8 +396,8 @@ suite('KeybindingsEditorModel', () => {
await testObject.resolve(new Map<string, string>()); await testObject.resolve(new Map<string, string>());
const actual = testObject.fetch('control').filter(element => element.keybindingItem.command === command); const actual = testObject.fetch('control').filter(element => element.keybindingItem.command === command);
assert.strictEqual(1, actual.length); assert.strictEqual(1, actual.length);
assert.deepEqual(actual[0].keybindingMatches!.firstPart, { ctrlKey: true }); assert.deepStrictEqual(actual[0].keybindingMatches!.firstPart, { ctrlKey: true });
assert.deepEqual(actual[0].keybindingMatches!.chordPart, {}); assert.deepStrictEqual(actual[0].keybindingMatches!.chordPart, {});
}); });
test('filter by shift key', async () => { test('filter by shift key', async () => {
@ -408,8 +408,8 @@ suite('KeybindingsEditorModel', () => {
await testObject.resolve(new Map<string, string>()); await testObject.resolve(new Map<string, string>());
const actual = testObject.fetch('shift').filter(element => element.keybindingItem.command === command); const actual = testObject.fetch('shift').filter(element => element.keybindingItem.command === command);
assert.strictEqual(1, actual.length); assert.strictEqual(1, actual.length);
assert.deepEqual(actual[0].keybindingMatches!.firstPart, { shiftKey: true }); assert.deepStrictEqual(actual[0].keybindingMatches!.firstPart, { shiftKey: true });
assert.deepEqual(actual[0].keybindingMatches!.chordPart, {}); assert.deepStrictEqual(actual[0].keybindingMatches!.chordPart, {});
}); });
test('filter by arrow', async () => { test('filter by arrow', async () => {
@ -420,8 +420,8 @@ suite('KeybindingsEditorModel', () => {
await testObject.resolve(new Map<string, string>()); await testObject.resolve(new Map<string, string>());
const actual = testObject.fetch('arrow').filter(element => element.keybindingItem.command === command); const actual = testObject.fetch('arrow').filter(element => element.keybindingItem.command === command);
assert.strictEqual(1, actual.length); assert.strictEqual(1, actual.length);
assert.deepEqual(actual[0].keybindingMatches!.firstPart, { keyCode: true }); assert.deepStrictEqual(actual[0].keybindingMatches!.firstPart, { keyCode: true });
assert.deepEqual(actual[0].keybindingMatches!.chordPart, {}); assert.deepStrictEqual(actual[0].keybindingMatches!.chordPart, {});
}); });
test('filter by modifier and key', async () => { test('filter by modifier and key', async () => {
@ -432,8 +432,8 @@ suite('KeybindingsEditorModel', () => {
await testObject.resolve(new Map<string, string>()); await testObject.resolve(new Map<string, string>());
const actual = testObject.fetch('alt right').filter(element => element.keybindingItem.command === command); const actual = testObject.fetch('alt right').filter(element => element.keybindingItem.command === command);
assert.strictEqual(1, actual.length); assert.strictEqual(1, actual.length);
assert.deepEqual(actual[0].keybindingMatches!.firstPart, { altKey: true, keyCode: true }); assert.deepStrictEqual(actual[0].keybindingMatches!.firstPart, { altKey: true, keyCode: true });
assert.deepEqual(actual[0].keybindingMatches!.chordPart, {}); assert.deepStrictEqual(actual[0].keybindingMatches!.chordPart, {});
}); });
test('filter by key and modifier', async () => { test('filter by key and modifier', async () => {
@ -455,8 +455,8 @@ suite('KeybindingsEditorModel', () => {
await testObject.resolve(new Map<string, string>()); await testObject.resolve(new Map<string, string>());
const actual = testObject.fetch('alt cmd esc').filter(element => element.keybindingItem.command === command); const actual = testObject.fetch('alt cmd esc').filter(element => element.keybindingItem.command === command);
assert.strictEqual(1, actual.length); assert.strictEqual(1, actual.length);
assert.deepEqual(actual[0].keybindingMatches!.firstPart, { altKey: true, metaKey: true, keyCode: true }); assert.deepStrictEqual(actual[0].keybindingMatches!.firstPart, { altKey: true, metaKey: true, keyCode: true });
assert.deepEqual(actual[0].keybindingMatches!.chordPart, {}); assert.deepStrictEqual(actual[0].keybindingMatches!.chordPart, {});
}); });
test('filter by modifiers in random order and key', async () => { test('filter by modifiers in random order and key', async () => {
@ -468,8 +468,8 @@ suite('KeybindingsEditorModel', () => {
await testObject.resolve(new Map<string, string>()); await testObject.resolve(new Map<string, string>());
const actual = testObject.fetch('cmd shift esc').filter(element => element.keybindingItem.command === command); const actual = testObject.fetch('cmd shift esc').filter(element => element.keybindingItem.command === command);
assert.strictEqual(1, actual.length); assert.strictEqual(1, actual.length);
assert.deepEqual(actual[0].keybindingMatches!.firstPart, { metaKey: true, shiftKey: true, keyCode: true }); assert.deepStrictEqual(actual[0].keybindingMatches!.firstPart, { metaKey: true, shiftKey: true, keyCode: true });
assert.deepEqual(actual[0].keybindingMatches!.chordPart, {}); assert.deepStrictEqual(actual[0].keybindingMatches!.chordPart, {});
}); });
test('filter by first part', async () => { test('filter by first part', async () => {
@ -481,8 +481,8 @@ suite('KeybindingsEditorModel', () => {
await testObject.resolve(new Map<string, string>()); await testObject.resolve(new Map<string, string>());
const actual = testObject.fetch('cmd shift esc').filter(element => element.keybindingItem.command === command); const actual = testObject.fetch('cmd shift esc').filter(element => element.keybindingItem.command === command);
assert.strictEqual(1, actual.length); assert.strictEqual(1, actual.length);
assert.deepEqual(actual[0].keybindingMatches!.firstPart, { metaKey: true, shiftKey: true, keyCode: true }); assert.deepStrictEqual(actual[0].keybindingMatches!.firstPart, { metaKey: true, shiftKey: true, keyCode: true });
assert.deepEqual(actual[0].keybindingMatches!.chordPart, {}); assert.deepStrictEqual(actual[0].keybindingMatches!.chordPart, {});
}); });
test('filter matches in chord part', async () => { test('filter matches in chord part', async () => {
@ -494,8 +494,8 @@ suite('KeybindingsEditorModel', () => {
await testObject.resolve(new Map<string, string>()); await testObject.resolve(new Map<string, string>());
const actual = testObject.fetch('cmd del').filter(element => element.keybindingItem.command === command); const actual = testObject.fetch('cmd del').filter(element => element.keybindingItem.command === command);
assert.strictEqual(1, actual.length); assert.strictEqual(1, actual.length);
assert.deepEqual(actual[0].keybindingMatches!.firstPart, { metaKey: true }); assert.deepStrictEqual(actual[0].keybindingMatches!.firstPart, { metaKey: true });
assert.deepEqual(actual[0].keybindingMatches!.chordPart, { keyCode: true }); assert.deepStrictEqual(actual[0].keybindingMatches!.chordPart, { keyCode: true });
}); });
test('filter matches first part and in chord part', async () => { test('filter matches first part and in chord part', async () => {
@ -507,8 +507,8 @@ suite('KeybindingsEditorModel', () => {
await testObject.resolve(new Map<string, string>()); await testObject.resolve(new Map<string, string>());
const actual = testObject.fetch('cmd shift esc del').filter(element => element.keybindingItem.command === command); const actual = testObject.fetch('cmd shift esc del').filter(element => element.keybindingItem.command === command);
assert.strictEqual(1, actual.length); assert.strictEqual(1, actual.length);
assert.deepEqual(actual[0].keybindingMatches!.firstPart, { shiftKey: true, metaKey: true, keyCode: true }); assert.deepStrictEqual(actual[0].keybindingMatches!.firstPart, { shiftKey: true, metaKey: true, keyCode: true });
assert.deepEqual(actual[0].keybindingMatches!.chordPart, { keyCode: true }); assert.deepStrictEqual(actual[0].keybindingMatches!.chordPart, { keyCode: true });
}); });
test('filter exact matches', async () => { test('filter exact matches', async () => {
@ -519,8 +519,8 @@ suite('KeybindingsEditorModel', () => {
await testObject.resolve(new Map<string, string>()); await testObject.resolve(new Map<string, string>());
const actual = testObject.fetch('"ctrl c"').filter(element => element.keybindingItem.command === command); const actual = testObject.fetch('"ctrl c"').filter(element => element.keybindingItem.command === command);
assert.strictEqual(1, actual.length); assert.strictEqual(1, actual.length);
assert.deepEqual(actual[0].keybindingMatches!.firstPart, { ctrlKey: true, keyCode: true }); assert.deepStrictEqual(actual[0].keybindingMatches!.firstPart, { ctrlKey: true, keyCode: true });
assert.deepEqual(actual[0].keybindingMatches!.chordPart, {}); assert.deepStrictEqual(actual[0].keybindingMatches!.chordPart, {});
}); });
test('filter exact matches with first and chord part', async () => { test('filter exact matches with first and chord part', async () => {
@ -531,8 +531,8 @@ suite('KeybindingsEditorModel', () => {
await testObject.resolve(new Map<string, string>()); await testObject.resolve(new Map<string, string>());
const actual = testObject.fetch('"shift meta escape ctrl c"').filter(element => element.keybindingItem.command === command); const actual = testObject.fetch('"shift meta escape ctrl c"').filter(element => element.keybindingItem.command === command);
assert.strictEqual(1, actual.length); assert.strictEqual(1, actual.length);
assert.deepEqual(actual[0].keybindingMatches!.firstPart, { shiftKey: true, metaKey: true, keyCode: true }); assert.deepStrictEqual(actual[0].keybindingMatches!.firstPart, { shiftKey: true, metaKey: true, keyCode: true });
assert.deepEqual(actual[0].keybindingMatches!.chordPart, { ctrlKey: true, keyCode: true }); assert.deepStrictEqual(actual[0].keybindingMatches!.chordPart, { ctrlKey: true, keyCode: true });
}); });
test('filter exact matches with first and chord part no results', async () => { test('filter exact matches with first and chord part no results', async () => {
@ -554,8 +554,8 @@ suite('KeybindingsEditorModel', () => {
await testObject.resolve(new Map<string, string>()); await testObject.resolve(new Map<string, string>());
const actual = testObject.fetch('"control+c"').filter(element => element.keybindingItem.command === command); const actual = testObject.fetch('"control+c"').filter(element => element.keybindingItem.command === command);
assert.strictEqual(1, actual.length); assert.strictEqual(1, actual.length);
assert.deepEqual(actual[0].keybindingMatches!.firstPart, { ctrlKey: true, keyCode: true }); assert.deepStrictEqual(actual[0].keybindingMatches!.firstPart, { ctrlKey: true, keyCode: true });
assert.deepEqual(actual[0].keybindingMatches!.chordPart, {}); assert.deepStrictEqual(actual[0].keybindingMatches!.chordPart, {});
}); });
test('filter by keybinding prefix', async () => { test('filter by keybinding prefix', async () => {
@ -566,8 +566,8 @@ suite('KeybindingsEditorModel', () => {
await testObject.resolve(new Map<string, string>()); await testObject.resolve(new Map<string, string>());
const actual = testObject.fetch('@keybinding:control+c').filter(element => element.keybindingItem.command === command); const actual = testObject.fetch('@keybinding:control+c').filter(element => element.keybindingItem.command === command);
assert.strictEqual(1, actual.length); assert.strictEqual(1, actual.length);
assert.deepEqual(actual[0].keybindingMatches!.firstPart, { ctrlKey: true, keyCode: true }); assert.deepStrictEqual(actual[0].keybindingMatches!.firstPart, { ctrlKey: true, keyCode: true });
assert.deepEqual(actual[0].keybindingMatches!.chordPart, {}); assert.deepStrictEqual(actual[0].keybindingMatches!.chordPart, {});
}); });
test('filter matches with + separator in first and chord parts', async () => { test('filter matches with + separator in first and chord parts', async () => {
@ -578,8 +578,8 @@ suite('KeybindingsEditorModel', () => {
await testObject.resolve(new Map<string, string>()); await testObject.resolve(new Map<string, string>());
const actual = testObject.fetch('"shift+meta+escape ctrl+c"').filter(element => element.keybindingItem.command === command); const actual = testObject.fetch('"shift+meta+escape ctrl+c"').filter(element => element.keybindingItem.command === command);
assert.strictEqual(1, actual.length); assert.strictEqual(1, actual.length);
assert.deepEqual(actual[0].keybindingMatches!.firstPart, { shiftKey: true, metaKey: true, keyCode: true }); assert.deepStrictEqual(actual[0].keybindingMatches!.firstPart, { shiftKey: true, metaKey: true, keyCode: true });
assert.deepEqual(actual[0].keybindingMatches!.chordPart, { keyCode: true, ctrlKey: true }); assert.deepStrictEqual(actual[0].keybindingMatches!.chordPart, { keyCode: true, ctrlKey: true });
}); });
test('filter by keybinding prefix with chord', async () => { test('filter by keybinding prefix with chord', async () => {
@ -590,8 +590,8 @@ suite('KeybindingsEditorModel', () => {
await testObject.resolve(new Map<string, string>()); await testObject.resolve(new Map<string, string>());
const actual = testObject.fetch('@keybinding:"shift+meta+escape ctrl+c"').filter(element => element.keybindingItem.command === command); const actual = testObject.fetch('@keybinding:"shift+meta+escape ctrl+c"').filter(element => element.keybindingItem.command === command);
assert.strictEqual(1, actual.length); assert.strictEqual(1, actual.length);
assert.deepEqual(actual[0].keybindingMatches!.firstPart, { shiftKey: true, metaKey: true, keyCode: true }); assert.deepStrictEqual(actual[0].keybindingMatches!.firstPart, { shiftKey: true, metaKey: true, keyCode: true });
assert.deepEqual(actual[0].keybindingMatches!.chordPart, { keyCode: true, ctrlKey: true }); assert.deepStrictEqual(actual[0].keybindingMatches!.chordPart, { keyCode: true, ctrlKey: true });
}); });
test('filter exact matches with space #32993', async () => { test('filter exact matches with space #32993', async () => {
@ -613,7 +613,7 @@ suite('KeybindingsEditorModel', () => {
await testObject.resolve(new Map<string, string>()); await testObject.resolve(new Map<string, string>());
const actual = testObject.fetch('"down"').filter(element => element.keybindingItem.command === command); const actual = testObject.fetch('"down"').filter(element => element.keybindingItem.command === command);
assert.strictEqual(1, actual.length); assert.strictEqual(1, actual.length);
assert.deepEqual(actual[0].keybindingMatches!.firstPart, { keyCode: true }); assert.deepStrictEqual(actual[0].keybindingMatches!.firstPart, { keyCode: true });
}); });
test('filter modifiers are not matched when not completely matched (prefix)', async () => { test('filter modifiers are not matched when not completely matched (prefix)', async () => {
@ -653,7 +653,7 @@ suite('KeybindingsEditorModel', () => {
await testObject.resolve(new Map<string, string>()); await testObject.resolve(new Map<string, string>());
const actual = testObject.fetch('alt').filter(element => element.keybindingItem.command === command); const actual = testObject.fetch('alt').filter(element => element.keybindingItem.command === command);
assert.strictEqual(1, actual.length); assert.strictEqual(1, actual.length);
assert.deepEqual(actual[0].keybindingMatches!.firstPart, { altKey: true }); assert.deepStrictEqual(actual[0].keybindingMatches!.firstPart, { altKey: true });
}); });
function prepareKeybindingService(...keybindingItems: ResolvedKeybindingItem[]): ResolvedKeybindingItem[] { function prepareKeybindingService(...keybindingItems: ResolvedKeybindingItem[]): ResolvedKeybindingItem[] {

View file

@ -79,11 +79,11 @@ suite('Replace Pattern test', () => {
test('create pattern by passing regExp', () => { test('create pattern by passing regExp', () => {
let expected = /abc/; let expected = /abc/;
let actual = new ReplacePattern('hello', false, expected).regExp; let actual = new ReplacePattern('hello', false, expected).regExp;
assert.deepEqual(expected, actual); assert.deepStrictEqual(expected, actual);
expected = /abc/; expected = /abc/;
actual = new ReplacePattern('hello', false, /abc/g).regExp; actual = new ReplacePattern('hello', false, /abc/g).regExp;
assert.deepEqual(expected, actual); assert.deepStrictEqual(expected, actual);
let testObject = new ReplacePattern('hello$0', false, /abc/g); let testObject = new ReplacePattern('hello$0', false, /abc/g);
assert.strictEqual(false, testObject.hasParameters); assert.strictEqual(false, testObject.hasParameters);

View file

@ -21,49 +21,49 @@ suite('TextSearchResult', () => {
test('empty without preview options', () => { test('empty without preview options', () => {
const range = new OneLineRange(5, 0, 0); const range = new OneLineRange(5, 0, 0);
const result = new TextSearchMatch('', range); const result = new TextSearchMatch('', range);
assert.deepEqual(result.ranges, range); assert.deepStrictEqual(result.ranges, range);
assertOneLinePreviewRangeText('', result); assertOneLinePreviewRangeText('', result);
}); });
test('empty with preview options', () => { test('empty with preview options', () => {
const range = new OneLineRange(5, 0, 0); const range = new OneLineRange(5, 0, 0);
const result = new TextSearchMatch('', range, previewOptions1); const result = new TextSearchMatch('', range, previewOptions1);
assert.deepEqual(result.ranges, range); assert.deepStrictEqual(result.ranges, range);
assertOneLinePreviewRangeText('', result); assertOneLinePreviewRangeText('', result);
}); });
test('short without preview options', () => { test('short without preview options', () => {
const range = new OneLineRange(5, 4, 7); const range = new OneLineRange(5, 4, 7);
const result = new TextSearchMatch('foo bar', range); const result = new TextSearchMatch('foo bar', range);
assert.deepEqual(result.ranges, range); assert.deepStrictEqual(result.ranges, range);
assertOneLinePreviewRangeText('bar', result); assertOneLinePreviewRangeText('bar', result);
}); });
test('short with preview options', () => { test('short with preview options', () => {
const range = new OneLineRange(5, 4, 7); const range = new OneLineRange(5, 4, 7);
const result = new TextSearchMatch('foo bar', range, previewOptions1); const result = new TextSearchMatch('foo bar', range, previewOptions1);
assert.deepEqual(result.ranges, range); assert.deepStrictEqual(result.ranges, range);
assertOneLinePreviewRangeText('bar', result); assertOneLinePreviewRangeText('bar', result);
}); });
test('leading', () => { test('leading', () => {
const range = new OneLineRange(5, 25, 28); const range = new OneLineRange(5, 25, 28);
const result = new TextSearchMatch('long text very long text foo', range, previewOptions1); const result = new TextSearchMatch('long text very long text foo', range, previewOptions1);
assert.deepEqual(result.ranges, range); assert.deepStrictEqual(result.ranges, range);
assertOneLinePreviewRangeText('foo', result); assertOneLinePreviewRangeText('foo', result);
}); });
test('trailing', () => { test('trailing', () => {
const range = new OneLineRange(5, 0, 3); const range = new OneLineRange(5, 0, 3);
const result = new TextSearchMatch('foo long text very long text long text very long text long text very long text long text very long text long text very long text', range, previewOptions1); const result = new TextSearchMatch('foo long text very long text long text very long text long text very long text long text very long text long text very long text', range, previewOptions1);
assert.deepEqual(result.ranges, range); assert.deepStrictEqual(result.ranges, range);
assertOneLinePreviewRangeText('foo', result); assertOneLinePreviewRangeText('foo', result);
}); });
test('middle', () => { test('middle', () => {
const range = new OneLineRange(5, 30, 33); const range = new OneLineRange(5, 30, 33);
const result = new TextSearchMatch('long text very long text long foo text very long text long text very long text long text very long text long text very long text', range, previewOptions1); const result = new TextSearchMatch('long text very long text long foo text very long text long text very long text long text very long text long text very long text', range, previewOptions1);
assert.deepEqual(result.ranges, range); assert.deepStrictEqual(result.ranges, range);
assertOneLinePreviewRangeText('foo', result); assertOneLinePreviewRangeText('foo', result);
}); });
@ -75,7 +75,7 @@ suite('TextSearchResult', () => {
const range = new OneLineRange(0, 4, 7); const range = new OneLineRange(0, 4, 7);
const result = new TextSearchMatch('foo bar', range, previewOptions); const result = new TextSearchMatch('foo bar', range, previewOptions);
assert.deepEqual(result.ranges, range); assert.deepStrictEqual(result.ranges, range);
assertOneLinePreviewRangeText('b', result); assertOneLinePreviewRangeText('b', result);
}); });
@ -87,7 +87,7 @@ suite('TextSearchResult', () => {
const range = new SearchRange(5, 4, 6, 3); const range = new SearchRange(5, 4, 6, 3);
const result = new TextSearchMatch('foo bar\nfoo bar', range, previewOptions); const result = new TextSearchMatch('foo bar\nfoo bar', range, previewOptions);
assert.deepEqual(result.ranges, range); assert.deepStrictEqual(result.ranges, range);
assert.strictEqual(result.preview.text, 'foo bar\nfoo bar'); assert.strictEqual(result.preview.text, 'foo bar\nfoo bar');
assert.strictEqual((<SearchRange>result.preview.matches).startLineNumber, 0); assert.strictEqual((<SearchRange>result.preview.matches).startLineNumber, 0);
assert.strictEqual((<SearchRange>result.preview.matches).startColumn, 4); assert.strictEqual((<SearchRange>result.preview.matches).startColumn, 4);

View file

@ -90,7 +90,7 @@ suite('SearchHelpers', () => {
ranges: new Range(0, 0, 0, 10) ranges: new Range(0, 0, 0, 10)
}]; }];
assert.deepEqual(addContextToEditorMatches(matches, mockTextModel, getQuery()), matches); assert.deepStrictEqual(addContextToEditorMatches(matches, mockTextModel, getQuery()), matches);
}); });
test('simple', () => { test('simple', () => {
@ -102,7 +102,7 @@ suite('SearchHelpers', () => {
ranges: new Range(1, 0, 1, 10) ranges: new Range(1, 0, 1, 10)
}]; }];
assert.deepEqual(addContextToEditorMatches(matches, mockTextModel, getQuery(1, 2)), [ assert.deepStrictEqual(addContextToEditorMatches(matches, mockTextModel, getQuery(1, 2)), [
<ITextSearchContext>{ <ITextSearchContext>{
text: '1', text: '1',
lineNumber: 0 lineNumber: 0
@ -136,7 +136,7 @@ suite('SearchHelpers', () => {
ranges: new Range(2, 0, 2, 10) ranges: new Range(2, 0, 2, 10)
}]; }];
assert.deepEqual(addContextToEditorMatches(matches, mockTextModel, getQuery(1, 2)), [ assert.deepStrictEqual(addContextToEditorMatches(matches, mockTextModel, getQuery(1, 2)), [
<ITextSearchContext>{ <ITextSearchContext>{
text: '1', text: '1',
lineNumber: 0 lineNumber: 0
@ -170,7 +170,7 @@ suite('SearchHelpers', () => {
ranges: new Range(MOCK_LINE_COUNT - 1, 0, MOCK_LINE_COUNT - 1, 10) ranges: new Range(MOCK_LINE_COUNT - 1, 0, MOCK_LINE_COUNT - 1, 10)
}]; }];
assert.deepEqual(addContextToEditorMatches(matches, mockTextModel, getQuery(1, 2)), [ assert.deepStrictEqual(addContextToEditorMatches(matches, mockTextModel, getQuery(1, 2)), [
matches[0], matches[0],
<ITextSearchContext>{ <ITextSearchContext>{
text: '2', text: '2',

View file

@ -105,7 +105,7 @@ suite('RipgrepTextSearchEngine', () => {
inputData.forEach(d => testParser.handleData(d)); inputData.forEach(d => testParser.handleData(d));
testParser.flush(); testParser.flush();
assert.deepEqual(actualResults, expectedResults); assert.deepStrictEqual(actualResults, expectedResults);
} }
function makeRgMatch(relativePath: string, text: string, lineNumber: number, matchRanges: { start: number, end: number }[]): string { function makeRgMatch(relativePath: string, text: string, lineNumber: number, matchRanges: { start: number, end: number }[]): string {

View file

@ -308,7 +308,7 @@ flakySuite('TextSearch-integration', function () {
return doSearchTest(config, 1).then(results => { return doSearchTest(config, 1).then(results => {
const matchRange = (<ITextSearchMatch>results[0].results![0]).ranges; const matchRange = (<ITextSearchMatch>results[0].results![0]).ranges;
assert.deepEqual(matchRange, [{ assert.deepStrictEqual(matchRange, [{
startLineNumber: 0, startLineNumber: 0,
startColumn: 1, startColumn: 1,
endLineNumber: 0, endLineNumber: 0,

View file

@ -84,8 +84,8 @@ suite('ViewContainerModel', () => {
assert.strictEqual(testObject.visibleViewDescriptors.length, 1); assert.strictEqual(testObject.visibleViewDescriptors.length, 1);
assert.strictEqual(target.elements.length, 1); assert.strictEqual(target.elements.length, 1);
assert.deepEqual(testObject.visibleViewDescriptors[0], viewDescriptor); assert.deepStrictEqual(testObject.visibleViewDescriptors[0], viewDescriptor);
assert.deepEqual(target.elements[0], viewDescriptor); assert.deepStrictEqual(target.elements[0], viewDescriptor);
ViewsRegistry.deregisterViews([viewDescriptor], container); ViewsRegistry.deregisterViews([viewDescriptor], container);
@ -119,7 +119,7 @@ suite('ViewContainerModel', () => {
await new Promise(c => setTimeout(c, 30)); await new Promise(c => setTimeout(c, 30));
assert.strictEqual(testObject.visibleViewDescriptors.length, 1, 'view should appear'); assert.strictEqual(testObject.visibleViewDescriptors.length, 1, 'view should appear');
assert.strictEqual(target.elements.length, 1); assert.strictEqual(target.elements.length, 1);
assert.deepEqual(testObject.visibleViewDescriptors[0], viewDescriptor); assert.deepStrictEqual(testObject.visibleViewDescriptors[0], viewDescriptor);
assert.strictEqual(target.elements[0], viewDescriptor); assert.strictEqual(target.elements[0], viewDescriptor);
key.set(false); key.set(false);
@ -145,17 +145,17 @@ suite('ViewContainerModel', () => {
const view2: IViewDescriptor = { id: 'view2', ctorDescriptor: null!, name: 'Test View 2', when: ContextKeyExpr.equals('showview2', true) }; const view2: IViewDescriptor = { id: 'view2', ctorDescriptor: null!, name: 'Test View 2', when: ContextKeyExpr.equals('showview2', true) };
ViewsRegistry.registerViews([view1, view2], container); ViewsRegistry.registerViews([view1, view2], container);
assert.deepEqual(testObject.visibleViewDescriptors, [view1], 'only view1 should be visible'); assert.deepStrictEqual(testObject.visibleViewDescriptors, [view1], 'only view1 should be visible');
assert.deepEqual(target.elements, [view1], 'only view1 should be visible'); assert.deepStrictEqual(target.elements, [view1], 'only view1 should be visible');
const key = contextKeyService.createKey('showview2', false); const key = contextKeyService.createKey('showview2', false);
assert.deepEqual(testObject.visibleViewDescriptors, [view1], 'still only view1 should be visible'); assert.deepStrictEqual(testObject.visibleViewDescriptors, [view1], 'still only view1 should be visible');
assert.deepEqual(target.elements, [view1], 'still only view1 should be visible'); assert.deepStrictEqual(target.elements, [view1], 'still only view1 should be visible');
key.set(true); key.set(true);
await new Promise(c => setTimeout(c, 30)); await new Promise(c => setTimeout(c, 30));
assert.deepEqual(testObject.visibleViewDescriptors, [view1, view2], 'both views should be visible'); assert.deepStrictEqual(testObject.visibleViewDescriptors, [view1, view2], 'both views should be visible');
assert.deepEqual(target.elements, [view1, view2], 'both views should be visible'); assert.deepStrictEqual(target.elements, [view1, view2], 'both views should be visible');
ViewsRegistry.deregisterViews([view1, view2], container); ViewsRegistry.deregisterViews([view1, view2], container);
}); });
@ -168,17 +168,17 @@ suite('ViewContainerModel', () => {
const view2: IViewDescriptor = { id: 'view2', ctorDescriptor: null!, name: 'Test View 2' }; const view2: IViewDescriptor = { id: 'view2', ctorDescriptor: null!, name: 'Test View 2' };
ViewsRegistry.registerViews([view1, view2], container); ViewsRegistry.registerViews([view1, view2], container);
assert.deepEqual(testObject.visibleViewDescriptors, [view2], 'only view2 should be visible'); assert.deepStrictEqual(testObject.visibleViewDescriptors, [view2], 'only view2 should be visible');
assert.deepEqual(target.elements, [view2], 'only view2 should be visible'); assert.deepStrictEqual(target.elements, [view2], 'only view2 should be visible');
const key = contextKeyService.createKey('showview1', false); const key = contextKeyService.createKey('showview1', false);
assert.deepEqual(testObject.visibleViewDescriptors, [view2], 'still only view2 should be visible'); assert.deepStrictEqual(testObject.visibleViewDescriptors, [view2], 'still only view2 should be visible');
assert.deepEqual(target.elements, [view2], 'still only view2 should be visible'); assert.deepStrictEqual(target.elements, [view2], 'still only view2 should be visible');
key.set(true); key.set(true);
await new Promise(c => setTimeout(c, 30)); await new Promise(c => setTimeout(c, 30));
assert.deepEqual(testObject.visibleViewDescriptors, [view1, view2], 'both views should be visible'); assert.deepStrictEqual(testObject.visibleViewDescriptors, [view1, view2], 'both views should be visible');
assert.deepEqual(target.elements, [view1, view2], 'both views should be visible'); assert.deepStrictEqual(target.elements, [view1, view2], 'both views should be visible');
ViewsRegistry.deregisterViews([view1, view2], container); ViewsRegistry.deregisterViews([view1, view2], container);
}); });
@ -192,40 +192,40 @@ suite('ViewContainerModel', () => {
const view3: IViewDescriptor = { id: 'view3', ctorDescriptor: null!, name: 'Test View 3', canToggleVisibility: true }; const view3: IViewDescriptor = { id: 'view3', ctorDescriptor: null!, name: 'Test View 3', canToggleVisibility: true };
ViewsRegistry.registerViews([view1, view2, view3], container); ViewsRegistry.registerViews([view1, view2, view3], container);
assert.deepEqual(testObject.visibleViewDescriptors, [view1, view2, view3]); assert.deepStrictEqual(testObject.visibleViewDescriptors, [view1, view2, view3]);
assert.deepEqual(target.elements, [view1, view2, view3]); assert.deepStrictEqual(target.elements, [view1, view2, view3]);
testObject.setVisible('view2', true); testObject.setVisible('view2', true);
assert.deepEqual(testObject.visibleViewDescriptors, [view1, view2, view3], 'nothing should happen'); assert.deepStrictEqual(testObject.visibleViewDescriptors, [view1, view2, view3], 'nothing should happen');
assert.deepEqual(target.elements, [view1, view2, view3]); assert.deepStrictEqual(target.elements, [view1, view2, view3]);
testObject.setVisible('view2', false); testObject.setVisible('view2', false);
assert.deepEqual(testObject.visibleViewDescriptors, [view1, view3], 'view2 should hide'); assert.deepStrictEqual(testObject.visibleViewDescriptors, [view1, view3], 'view2 should hide');
assert.deepEqual(target.elements, [view1, view3]); assert.deepStrictEqual(target.elements, [view1, view3]);
testObject.setVisible('view1', false); testObject.setVisible('view1', false);
assert.deepEqual(testObject.visibleViewDescriptors, [view3], 'view1 should hide'); assert.deepStrictEqual(testObject.visibleViewDescriptors, [view3], 'view1 should hide');
assert.deepEqual(target.elements, [view3]); assert.deepStrictEqual(target.elements, [view3]);
testObject.setVisible('view3', false); testObject.setVisible('view3', false);
assert.deepEqual(testObject.visibleViewDescriptors, [], 'view3 shoud hide'); assert.deepStrictEqual(testObject.visibleViewDescriptors, [], 'view3 shoud hide');
assert.deepEqual(target.elements, []); assert.deepStrictEqual(target.elements, []);
testObject.setVisible('view1', true); testObject.setVisible('view1', true);
assert.deepEqual(testObject.visibleViewDescriptors, [view1], 'view1 should show'); assert.deepStrictEqual(testObject.visibleViewDescriptors, [view1], 'view1 should show');
assert.deepEqual(target.elements, [view1]); assert.deepStrictEqual(target.elements, [view1]);
testObject.setVisible('view3', true); testObject.setVisible('view3', true);
assert.deepEqual(testObject.visibleViewDescriptors, [view1, view3], 'view3 should show'); assert.deepStrictEqual(testObject.visibleViewDescriptors, [view1, view3], 'view3 should show');
assert.deepEqual(target.elements, [view1, view3]); assert.deepStrictEqual(target.elements, [view1, view3]);
testObject.setVisible('view2', true); testObject.setVisible('view2', true);
assert.deepEqual(testObject.visibleViewDescriptors, [view1, view2, view3], 'view2 should show'); assert.deepStrictEqual(testObject.visibleViewDescriptors, [view1, view2, view3], 'view2 should show');
assert.deepEqual(target.elements, [view1, view2, view3]); assert.deepStrictEqual(target.elements, [view1, view2, view3]);
ViewsRegistry.deregisterViews([view1, view2, view3], container); ViewsRegistry.deregisterViews([view1, view2, view3], container);
assert.deepEqual(testObject.visibleViewDescriptors, []); assert.deepStrictEqual(testObject.visibleViewDescriptors, []);
assert.deepEqual(target.elements, []); assert.deepStrictEqual(target.elements, []);
}); });
test('move', () => { test('move', () => {
@ -237,24 +237,24 @@ suite('ViewContainerModel', () => {
const view3: IViewDescriptor = { id: 'view3', ctorDescriptor: null!, name: 'Test View 3' }; const view3: IViewDescriptor = { id: 'view3', ctorDescriptor: null!, name: 'Test View 3' };
ViewsRegistry.registerViews([view1, view2, view3], container); ViewsRegistry.registerViews([view1, view2, view3], container);
assert.deepEqual(testObject.visibleViewDescriptors, [view1, view2, view3], 'model views should be OK'); assert.deepStrictEqual(testObject.visibleViewDescriptors, [view1, view2, view3], 'model views should be OK');
assert.deepEqual(target.elements, [view1, view2, view3], 'sql views should be OK'); assert.deepStrictEqual(target.elements, [view1, view2, view3], 'sql views should be OK');
testObject.move('view3', 'view1'); testObject.move('view3', 'view1');
assert.deepEqual(testObject.visibleViewDescriptors, [view3, view1, view2], 'view3 should go to the front'); assert.deepStrictEqual(testObject.visibleViewDescriptors, [view3, view1, view2], 'view3 should go to the front');
assert.deepEqual(target.elements, [view3, view1, view2]); assert.deepStrictEqual(target.elements, [view3, view1, view2]);
testObject.move('view1', 'view2'); testObject.move('view1', 'view2');
assert.deepEqual(testObject.visibleViewDescriptors, [view3, view2, view1], 'view1 should go to the end'); assert.deepStrictEqual(testObject.visibleViewDescriptors, [view3, view2, view1], 'view1 should go to the end');
assert.deepEqual(target.elements, [view3, view2, view1]); assert.deepStrictEqual(target.elements, [view3, view2, view1]);
testObject.move('view1', 'view3'); testObject.move('view1', 'view3');
assert.deepEqual(testObject.visibleViewDescriptors, [view1, view3, view2], 'view1 should go to the front'); assert.deepStrictEqual(testObject.visibleViewDescriptors, [view1, view3, view2], 'view1 should go to the front');
assert.deepEqual(target.elements, [view1, view3, view2]); assert.deepStrictEqual(target.elements, [view1, view3, view2]);
testObject.move('view2', 'view3'); testObject.move('view2', 'view3');
assert.deepEqual(testObject.visibleViewDescriptors, [view1, view2, view3], 'view2 should go to the middle'); assert.deepStrictEqual(testObject.visibleViewDescriptors, [view1, view2, view3], 'view2 should go to the middle');
assert.deepEqual(target.elements, [view1, view2, view3]); assert.deepStrictEqual(target.elements, [view1, view2, view3]);
}); });
test('view states', async function () { test('view states', async function () {
@ -335,22 +335,22 @@ suite('ViewContainerModel', () => {
}; };
ViewsRegistry.registerViews([view1, view2, view3], container); ViewsRegistry.registerViews([view1, view2, view3], container);
assert.deepEqual(testObject.visibleViewDescriptors, [view2], 'Only view2 should be visible'); assert.deepStrictEqual(testObject.visibleViewDescriptors, [view2], 'Only view2 should be visible');
assert.deepEqual(target.elements, [view2]); assert.deepStrictEqual(target.elements, [view2]);
const key = contextKeyService.createKey('showview', false); const key = contextKeyService.createKey('showview', false);
assert.deepEqual(testObject.visibleViewDescriptors, [view2], 'Only view2 should be visible'); assert.deepStrictEqual(testObject.visibleViewDescriptors, [view2], 'Only view2 should be visible');
assert.deepEqual(target.elements, [view2]); assert.deepStrictEqual(target.elements, [view2]);
key.set(true); key.set(true);
await new Promise(c => setTimeout(c, 30)); await new Promise(c => setTimeout(c, 30));
assert.deepEqual(testObject.visibleViewDescriptors, [view2, view3], 'view3 should be visible'); assert.deepStrictEqual(testObject.visibleViewDescriptors, [view2, view3], 'view3 should be visible');
assert.deepEqual(target.elements, [view2, view3]); assert.deepStrictEqual(target.elements, [view2, view3]);
key.set(false); key.set(false);
await new Promise(c => setTimeout(c, 30)); await new Promise(c => setTimeout(c, 30));
assert.deepEqual(testObject.visibleViewDescriptors, [view2], 'Only view2 should be visible'); assert.deepStrictEqual(testObject.visibleViewDescriptors, [view2], 'Only view2 should be visible');
assert.deepEqual(target.elements, [view2]); assert.deepStrictEqual(target.elements, [view2]);
}); });
test('remove event is not triggered if view was hidden and removed', async function () { test('remove event is not triggered if view was hidden and removed', async function () {

View file

@ -69,7 +69,7 @@ suite('Editor - Range decorations', () => {
let actuals = rangeHighlightDecorations(model); let actuals = rangeHighlightDecorations(model);
assert.deepEqual([], actuals); assert.deepStrictEqual([], actuals);
}); });
test('highlight range for the resource removes previous highlight', function () { test('highlight range for the resource removes previous highlight', function () {
@ -90,7 +90,7 @@ suite('Editor - Range decorations', () => {
testObject.highlightRange({ resource: anotherModel.uri, range }); testObject.highlightRange({ resource: anotherModel.uri, range });
let actuals = rangeHighlightDecorations(model); let actuals = rangeHighlightDecorations(model);
assert.deepEqual([], actuals); assert.deepStrictEqual([], actuals);
actuals = rangeHighlightDecorations(anotherModel); actuals = rangeHighlightDecorations(anotherModel);
assert.deepEqual([range], actuals); assert.deepEqual([range], actuals);
}); });
@ -100,7 +100,7 @@ suite('Editor - Range decorations', () => {
prepareActiveEditor('anotherModel'); prepareActiveEditor('anotherModel');
let actuals = rangeHighlightDecorations(model); let actuals = rangeHighlightDecorations(model);
assert.deepEqual([], actuals); assert.deepStrictEqual([], actuals);
}); });
test('highlight is removed on cursor position change', function () { test('highlight is removed on cursor position change', function () {
@ -110,7 +110,7 @@ suite('Editor - Range decorations', () => {
}); });
let actuals = rangeHighlightDecorations(model); let actuals = rangeHighlightDecorations(model);
assert.deepEqual([], actuals); assert.deepStrictEqual([], actuals);
}); });
test('range is not highlight if not active editor', function () { test('range is not highlight if not active editor', function () {
@ -118,7 +118,7 @@ suite('Editor - Range decorations', () => {
testObject.highlightRange({ resource: model.uri, range: { startLineNumber: 1, startColumn: 1, endLineNumber: 1, endColumn: 1 } }); testObject.highlightRange({ resource: model.uri, range: { startLineNumber: 1, startColumn: 1, endLineNumber: 1, endColumn: 1 } });
let actuals = rangeHighlightDecorations(model); let actuals = rangeHighlightDecorations(model);
assert.deepEqual([], actuals); assert.deepStrictEqual([], actuals);
}); });
test('previous highlight is not removed if not active editor', function () { test('previous highlight is not removed if not active editor', function () {

View file

@ -183,7 +183,7 @@ suite('ExtHostSearch', () => {
function compareURIs(actual: URI[], expected: URI[]) { function compareURIs(actual: URI[], expected: URI[]) {
const sortAndStringify = (arr: URI[]) => arr.sort().map(u => u.toString()); const sortAndStringify = (arr: URI[]) => arr.sort().map(u => u.toString());
assert.deepEqual( assert.deepStrictEqual(
sortAndStringify(actual), sortAndStringify(actual),
sortAndStringify(expected)); sortAndStringify(expected));
} }
@ -286,11 +286,11 @@ suite('ExtHostSearch', () => {
await registerTestFileSearchProvider({ await registerTestFileSearchProvider({
provideFileSearchResults(query: vscode.FileSearchQuery, options: vscode.FileSearchOptions, token: vscode.CancellationToken): Promise<URI[]> { provideFileSearchResults(query: vscode.FileSearchQuery, options: vscode.FileSearchOptions, token: vscode.CancellationToken): Promise<URI[]> {
if (options.folder.toString() === rootFolderA.toString()) { if (options.folder.toString() === rootFolderA.toString()) {
assert.deepEqual(options.includes.sort(), ['*.ts', 'foo']); assert.deepStrictEqual(options.includes.sort(), ['*.ts', 'foo']);
assert.deepEqual(options.excludes.sort(), ['*.js', 'bar']); assert.deepStrictEqual(options.excludes.sort(), ['*.js', 'bar']);
} else { } else {
assert.deepEqual(options.includes.sort(), ['*.ts']); assert.deepStrictEqual(options.includes.sort(), ['*.ts']);
assert.deepEqual(options.excludes.sort(), ['*.js']); assert.deepStrictEqual(options.excludes.sort(), ['*.js']);
} }
return Promise.resolve(null!); return Promise.resolve(null!);
@ -327,8 +327,8 @@ suite('ExtHostSearch', () => {
test('include/excludes resolved correctly', async () => { test('include/excludes resolved correctly', async () => {
await registerTestFileSearchProvider({ await registerTestFileSearchProvider({
provideFileSearchResults(query: vscode.FileSearchQuery, options: vscode.FileSearchOptions, token: vscode.CancellationToken): Promise<URI[]> { provideFileSearchResults(query: vscode.FileSearchQuery, options: vscode.FileSearchOptions, token: vscode.CancellationToken): Promise<URI[]> {
assert.deepEqual(options.includes.sort(), ['*.jsx', '*.ts']); assert.deepStrictEqual(options.includes.sort(), ['*.jsx', '*.ts']);
assert.deepEqual(options.excludes.sort(), []); assert.deepStrictEqual(options.excludes.sort(), []);
return Promise.resolve(null!); return Promise.resolve(null!);
} }
@ -718,7 +718,7 @@ suite('ExtHostSearch', () => {
lineNumber: r.lineNumber lineNumber: r.lineNumber
}); });
return assert.deepEqual( return assert.deepStrictEqual(
makeComparable(actualTextSearchResults), makeComparable(actualTextSearchResults),
makeComparable(expected)); makeComparable(expected));
} }
@ -787,11 +787,11 @@ suite('ExtHostSearch', () => {
await registerTestTextSearchProvider({ await registerTestTextSearchProvider({
provideTextSearchResults(query: vscode.TextSearchQuery, options: vscode.TextSearchOptions, progress: vscode.Progress<vscode.TextSearchResult>, token: vscode.CancellationToken): Promise<vscode.TextSearchComplete> { provideTextSearchResults(query: vscode.TextSearchQuery, options: vscode.TextSearchOptions, progress: vscode.Progress<vscode.TextSearchResult>, token: vscode.CancellationToken): Promise<vscode.TextSearchComplete> {
if (options.folder.toString() === rootFolderA.toString()) { if (options.folder.toString() === rootFolderA.toString()) {
assert.deepEqual(options.includes.sort(), ['*.ts', 'foo']); assert.deepStrictEqual(options.includes.sort(), ['*.ts', 'foo']);
assert.deepEqual(options.excludes.sort(), ['*.js', 'bar']); assert.deepStrictEqual(options.excludes.sort(), ['*.js', 'bar']);
} else { } else {
assert.deepEqual(options.includes.sort(), ['*.ts']); assert.deepStrictEqual(options.includes.sort(), ['*.ts']);
assert.deepEqual(options.excludes.sort(), ['*.js']); assert.deepStrictEqual(options.excludes.sort(), ['*.js']);
} }
return Promise.resolve(null!); return Promise.resolve(null!);
@ -828,8 +828,8 @@ suite('ExtHostSearch', () => {
test('include/excludes resolved correctly', async () => { test('include/excludes resolved correctly', async () => {
await registerTestTextSearchProvider({ await registerTestTextSearchProvider({
provideTextSearchResults(query: vscode.TextSearchQuery, options: vscode.TextSearchOptions, progress: vscode.Progress<vscode.TextSearchResult>, token: vscode.CancellationToken): Promise<vscode.TextSearchComplete> { provideTextSearchResults(query: vscode.TextSearchQuery, options: vscode.TextSearchOptions, progress: vscode.Progress<vscode.TextSearchResult>, token: vscode.CancellationToken): Promise<vscode.TextSearchComplete> {
assert.deepEqual(options.includes.sort(), ['*.jsx', '*.ts']); assert.deepStrictEqual(options.includes.sort(), ['*.jsx', '*.ts']);
assert.deepEqual(options.excludes.sort(), []); assert.deepStrictEqual(options.excludes.sort(), []);
return Promise.resolve(null!); return Promise.resolve(null!);
} }

View file

@ -54,7 +54,7 @@ suite('MainThreadWorkspace', () => {
fileSearch(query: IFileQuery) { fileSearch(query: IFileQuery) {
assert.strictEqual(query.folderQueries.length, 1); assert.strictEqual(query.folderQueries.length, 1);
assert.strictEqual(query.folderQueries[0].disregardIgnoreFiles, true); assert.strictEqual(query.folderQueries[0].disregardIgnoreFiles, true);
assert.deepEqual(query.folderQueries[0].excludePattern, { 'filesExclude': true }); assert.deepStrictEqual(query.folderQueries[0].excludePattern, { 'filesExclude': true });
return Promise.resolve({ results: [] }); return Promise.resolve({ results: [] });
} }
@ -75,7 +75,7 @@ suite('MainThreadWorkspace', () => {
instantiationService.stub(ISearchService, { instantiationService.stub(ISearchService, {
fileSearch(query: IFileQuery) { fileSearch(query: IFileQuery) {
assert.strictEqual(query.folderQueries[0].excludePattern, undefined); assert.strictEqual(query.folderQueries[0].excludePattern, undefined);
assert.deepEqual(query.excludePattern, undefined); assert.deepStrictEqual(query.excludePattern, undefined);
return Promise.resolve({ results: [] }); return Promise.resolve({ results: [] });
} }

View file

@ -84,10 +84,10 @@ suite('Color Registry', function () {
} }
let undocumentedKeys = Object.keys(missing).map(k => `\`${k}\`: ${missing[k]}`); let undocumentedKeys = Object.keys(missing).map(k => `\`${k}\`: ${missing[k]}`);
assert.deepEqual(undocumentedKeys, [], 'Undocumented colors ids'); assert.deepStrictEqual(undocumentedKeys, [], 'Undocumented colors ids');
let superfluousKeys = Object.keys(colorsInDoc); let superfluousKeys = Object.keys(colorsInDoc);
assert.deepEqual(superfluousKeys, [], 'Colors ids in doc that do not exist'); assert.deepStrictEqual(superfluousKeys, [], 'Colors ids in doc that do not exist');
}); });
}); });

View file

@ -124,7 +124,7 @@ describe('API Integration Tests', function (): void {
await page.waitForTimeout(1000); await page.waitForTimeout(1000);
assert.deepEqual(await page.evaluate(` assert.deepStrictEqual(await page.evaluate(`
[ [
instance.getModel().getLineContent(1), instance.getModel().getLineContent(1),
instance.getModel().getLineContent(2), instance.getModel().getLineContent(2),