From d18462991fdf82f22f594b8fa7e6e09c16f59716 Mon Sep 17 00:00:00 2001 From: Rutger Hertogh Date: Sun, 2 Jun 2024 16:37:56 +0200 Subject: [PATCH] Updated JS test packages Updated Node (6 -> 20), NPM (6 -> 10), jsdom (11.11.0 -> 24.1.0), leche (2.2.3 -> 2.3.0), mocha (5.2.0 -> 6.2.3) --- .github/workflows/ci-node.yml | 6 +++--- framework/base/package.json | 6 ++++++ package.json | 6 +++--- tests/js/tests/yii.activeForm.test.js | 3 ++- tests/js/tests/yii.captcha.test.js | 3 ++- tests/js/tests/yii.gridView.test.js | 5 +++-- tests/js/tests/yii.test.js | 3 ++- tests/js/tests/yii.validation.test.js | 3 ++- 8 files changed, 23 insertions(+), 12 deletions(-) create mode 100644 framework/base/package.json diff --git a/.github/workflows/ci-node.yml b/.github/workflows/ci-node.yml index 3f49942b84a..345ef1b6e70 100644 --- a/.github/workflows/ci-node.yml +++ b/.github/workflows/ci-node.yml @@ -11,7 +11,7 @@ concurrency: jobs: test: - name: NPM 6 on ubuntu-latest + name: NPM 10 on ubuntu-latest runs-on: ubuntu-latest @@ -26,9 +26,9 @@ jobs: run: composer require "bower-asset/jquery:3.6.*@stable" - name: Install node.js. - uses: actions/setup-node@v1 + uses: actions/setup-node@v4 with: - node-version: 6 + node-version: 20 - name: Tests. run: | diff --git a/framework/base/package.json b/framework/base/package.json new file mode 100644 index 00000000000..63d00e462c9 --- /dev/null +++ b/framework/base/package.json @@ -0,0 +1,6 @@ +{ + "name": "base", + "version": "1.0.0", + "dependencies": { + } +} diff --git a/package.json b/package.json index e102ef18079..5d78e345bbe 100644 --- a/package.json +++ b/package.json @@ -9,9 +9,9 @@ "dependencies": {}, "devDependencies": { "chai": "^3.5.0", - "jsdom": "11.11.0", - "leche": "^2.2.3", - "mocha": "^5.2.0", + "jsdom": "24.1.0", + "leche": "^2.3.0", + "mocha": "^6.2.3", "mocha-jsdom": "^2.0.0", "sinon": "^1.17.6" }, diff --git a/tests/js/tests/yii.activeForm.test.js b/tests/js/tests/yii.activeForm.test.js index f79599b0747..506fe38a5a1 100644 --- a/tests/js/tests/yii.activeForm.test.js +++ b/tests/js/tests/yii.activeForm.test.js @@ -49,7 +49,8 @@ describe('yii.activeForm', function () { jsdom({ html: html, - src: fs.readFileSync(jQueryPath, 'utf-8') + src: fs.readFileSync(jQueryPath, 'utf-8'), + url: "http://foo.bar" }); before(function () { diff --git a/tests/js/tests/yii.captcha.test.js b/tests/js/tests/yii.captcha.test.js index 9fdd1d1d95f..8970b7decfb 100644 --- a/tests/js/tests/yii.captcha.test.js +++ b/tests/js/tests/yii.captcha.test.js @@ -30,7 +30,8 @@ describe('yii.captcha', function () { jsdom({ html: html, - src: fs.readFileSync(jQueryPath, 'utf-8') + src: fs.readFileSync(jQueryPath, 'utf-8'), + url: "http://foo.bar" }); before(function () { diff --git a/tests/js/tests/yii.gridView.test.js b/tests/js/tests/yii.gridView.test.js index 85f5b56637e..de13b4e7090 100644 --- a/tests/js/tests/yii.gridView.test.js +++ b/tests/js/tests/yii.gridView.test.js @@ -51,7 +51,8 @@ describe('yii.gridView', function () { jsdom({ html: html, - src: fs.readFileSync(jQueryPath, 'utf-8') + src: fs.readFileSync(jQueryPath, 'utf-8'), + url: "http://foo.bar" }); before(function () { @@ -787,7 +788,7 @@ describe('yii.gridView', function () { assert.throws(function () { $gridView1.yiiGridView('applyFilter'); - }, "Cannot read property 'settings' of undefined"); + }, "Cannot read properties of undefined (reading \'settings\')"); $gridView1.yiiGridView(settings); // Reinitialize without "beforeFilter" and "afterFilter" event handlers $gridView1.yiiGridView('applyFilter'); diff --git a/tests/js/tests/yii.test.js b/tests/js/tests/yii.test.js index 0164dcf8606..2072235002b 100644 --- a/tests/js/tests/yii.test.js +++ b/tests/js/tests/yii.test.js @@ -74,7 +74,8 @@ describe('yii', function () { jsdom({ html: fs.readFileSync('tests/js/data/yii.html', 'utf-8'), - src: fs.readFileSync(jQueryPath, 'utf-8') + src: fs.readFileSync(jQueryPath, 'utf-8'), + url: "http://foo.bar" }); before(function () { diff --git a/tests/js/tests/yii.validation.test.js b/tests/js/tests/yii.validation.test.js index 3fa08f45278..5cd742c075e 100644 --- a/tests/js/tests/yii.validation.test.js +++ b/tests/js/tests/yii.validation.test.js @@ -76,7 +76,8 @@ describe('yii.validation', function () { } jsdom({ - src: fs.readFileSync('vendor/bower-asset/jquery/dist/jquery.js', 'utf-8') + src: fs.readFileSync('vendor/bower-asset/jquery/dist/jquery.js', 'utf-8'), + url: "http://foo.bar" }); before(function () {