Commit 4f382c70 authored by dpapad's avatar dpapad Committed by Commit Bot

WebUI: Update third_party/chaijs 3.5.0 -> 4.2.0

The latest version makes it possible to import chai.js with a JS
module "import" statement.

Also:
 - Fixing a few occurrences where the latest version would throw
   errors, as it seems stricter into what can be passed into the
   assert methods. For example passing a string to
   chai.assert.isAbove() now throws an error.
 - Making a small local modification depicted in chromium.patch,
   necessary to run chai.js in d8, which does not gave a window
   or global object.

Bug: 1133198
Change-Id: I1a1503b3503b0f0dc54d537107714421f1865f6c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2498054Reviewed-by: default avatarJohn Lee <johntlee@chromium.org>
Commit-Queue: dpapad <dpapad@chromium.org>
Cr-Commit-Position: refs/heads/master@{#820886}
parent 0be17c5a
...@@ -62,7 +62,7 @@ suite('selection state', function() { ...@@ -62,7 +62,7 @@ suite('selection state', function() {
action = selectFolder('2'); action = selectFolder('2');
selection = updateSelection(selection, action); selection = updateSelection(selection, action);
assertDeepEquals({}, selection.items); assertDeepEquals(new Set(), selection.items);
}); });
test('is cleared when search finished', function() { test('is cleared when search finished', function() {
...@@ -71,7 +71,7 @@ suite('selection state', function() { ...@@ -71,7 +71,7 @@ suite('selection state', function() {
action = setSearchResults(['2']); action = setSearchResults(['2']);
selection = updateSelection(selection, action); selection = updateSelection(selection, action);
assertDeepEquals({}, selection.items); assertDeepEquals(new Set(), selection.items);
}); });
test('is cleared when search cleared', function() { test('is cleared when search cleared', function() {
...@@ -80,7 +80,7 @@ suite('selection state', function() { ...@@ -80,7 +80,7 @@ suite('selection state', function() {
action = clearSearch(); action = clearSearch();
selection = updateSelection(selection, action); selection = updateSelection(selection, action);
assertDeepEquals({}, selection.items); assertDeepEquals(new Set(), selection.items);
}); });
test('deselect items', function() { test('deselect items', function() {
...@@ -89,7 +89,7 @@ suite('selection state', function() { ...@@ -89,7 +89,7 @@ suite('selection state', function() {
action = deselectItems(); action = deselectItems();
selection = updateSelection(selection, action); selection = updateSelection(selection, action);
assertDeepEquals({}, selection.items); assertDeepEquals(new Set(), selection.items);
}); });
test('toggle an item', function() { test('toggle an item', function() {
......
...@@ -340,8 +340,8 @@ suite('SearchEnginePageTests', function() { ...@@ -340,8 +340,8 @@ suite('SearchEnginePageTests', function() {
// Ensure that the search engines have reverse alphabetical order in the // Ensure that the search engines have reverse alphabetical order in the
// model. // model.
assertGT( assertTrue(
searchEnginesInfo.others[0].name, searchEnginesInfo.others[1].name); searchEnginesInfo.others[0].name > searchEnginesInfo.others[1].name);
// Ensure that they are displayed in alphabetical order. // Ensure that they are displayed in alphabetical order.
assertEquals(searchEnginesInfo.others[1].name, othersEntries[0].name); assertEquals(searchEnginesInfo.others[1].name, othersEntries[0].name);
......
Name: Chai Assertion Library Name: Chai Assertion Library
Short Name: chai Short Name: chai
URL: https://github.com/chaijs/chai URL: https://github.com/chaijs/chai
Version: 3.5.0 Version: 4.2.0
Revision: 4ca0218391cf947c6cfac2d1a7424a63a4b4c232 Revision: 26c8a794ec6da695f004bdbd6362a466dc3d098f
Date: Thu Jan 28 11:54:31 2016 +0000 Date: 2018-09-25
License: MIT License: MIT
License File: NOT_SHIPPED License File: NOT_SHIPPED
Security Critical: no Security Critical: no
...@@ -15,6 +15,8 @@ paired with any testing framework. ...@@ -15,6 +15,8 @@ paired with any testing framework.
Local Modifications: Local Modifications:
- Copied license text out of README.md. - Copied license text out of README.md.
- Externs file from - Externs file from
https://github.com/google/closure-compiler/tree/master/contrib/externs https://github.com/google/closure-compiler/tree/master/contrib/externs
- Add mising assert.notStrictEqual - Add mising assert.notStrictEqual
- Add missing export of chai.expect - Add missing export of chai.expect
- Applied chromium.patch so that chai.js can run within a d8 shell, which is
used in unit_tests
This diff is collapsed.
diff --git a/third_party/chaijs/chai.js b/third_party/chaijs/chai.js
index 39429c51b912..067a18fb688d 100644
--- a/third_party/chaijs/chai.js
+++ b/third_party/chaijs/chai.js
@@ -10475,7 +10475,7 @@ module.exports = {
var promiseExists = typeof Promise === 'function';
/* eslint-disable no-undef */
-var globalObject = typeof self === 'object' ? self : global; // eslint-disable-line id-blacklist
+var globalObject = typeof self === 'object' ? self : null; // eslint-disable-line id-blacklist
var symbolExists = typeof Symbol !== 'undefined';
var mapExists = typeof Map !== 'undefined';
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment