Skip to content

Commit 855522c

Browse files
authored
Updated JS test packages (#20180)
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)
1 parent 6b1591b commit 855522c

File tree

8 files changed

+23
-12
lines changed

8 files changed

+23
-12
lines changed

.github/workflows/ci-node.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ concurrency:
1111

1212
jobs:
1313
test:
14-
name: NPM 6 on ubuntu-latest
14+
name: NPM 10 on ubuntu-latest
1515

1616
runs-on: ubuntu-latest
1717

@@ -26,9 +26,9 @@ jobs:
2626
run: composer require "bower-asset/jquery:3.6.*@stable"
2727

2828
- name: Install node.js.
29-
uses: actions/setup-node@v1
29+
uses: actions/setup-node@v4
3030
with:
31-
node-version: 6
31+
node-version: 20
3232

3333
- name: Tests.
3434
run: |

framework/base/package.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"name": "base",
3+
"version": "1.0.0",
4+
"dependencies": {
5+
}
6+
}

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99
"dependencies": {},
1010
"devDependencies": {
1111
"chai": "^3.5.0",
12-
"jsdom": "11.11.0",
13-
"leche": "^2.2.3",
14-
"mocha": "^5.2.0",
12+
"jsdom": "24.1.0",
13+
"leche": "^2.3.0",
14+
"mocha": "^6.2.3",
1515
"mocha-jsdom": "^2.0.0",
1616
"sinon": "^1.17.6"
1717
},

tests/js/tests/yii.activeForm.test.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,8 @@ describe('yii.activeForm', function () {
4949

5050
jsdom({
5151
html: html,
52-
src: fs.readFileSync(jQueryPath, 'utf-8')
52+
src: fs.readFileSync(jQueryPath, 'utf-8'),
53+
url: "http://foo.bar"
5354
});
5455

5556
before(function () {

tests/js/tests/yii.captcha.test.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ describe('yii.captcha', function () {
3030

3131
jsdom({
3232
html: html,
33-
src: fs.readFileSync(jQueryPath, 'utf-8')
33+
src: fs.readFileSync(jQueryPath, 'utf-8'),
34+
url: "http://foo.bar"
3435
});
3536

3637
before(function () {

tests/js/tests/yii.gridView.test.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,8 @@ describe('yii.gridView', function () {
5151

5252
jsdom({
5353
html: html,
54-
src: fs.readFileSync(jQueryPath, 'utf-8')
54+
src: fs.readFileSync(jQueryPath, 'utf-8'),
55+
url: "http://foo.bar"
5556
});
5657

5758
before(function () {
@@ -787,7 +788,7 @@ describe('yii.gridView', function () {
787788

788789
assert.throws(function () {
789790
$gridView1.yiiGridView('applyFilter');
790-
}, "Cannot read property 'settings' of undefined");
791+
}, "Cannot read properties of undefined (reading \'settings\')");
791792
$gridView1.yiiGridView(settings); // Reinitialize without "beforeFilter" and "afterFilter" event handlers
792793

793794
$gridView1.yiiGridView('applyFilter');

tests/js/tests/yii.test.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,8 @@ describe('yii', function () {
7474

7575
jsdom({
7676
html: fs.readFileSync('tests/js/data/yii.html', 'utf-8'),
77-
src: fs.readFileSync(jQueryPath, 'utf-8')
77+
src: fs.readFileSync(jQueryPath, 'utf-8'),
78+
url: "http://foo.bar"
7879
});
7980

8081
before(function () {

tests/js/tests/yii.validation.test.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,8 @@ describe('yii.validation', function () {
7676
}
7777

7878
jsdom({
79-
src: fs.readFileSync('vendor/bower-asset/jquery/dist/jquery.js', 'utf-8')
79+
src: fs.readFileSync('vendor/bower-asset/jquery/dist/jquery.js', 'utf-8'),
80+
url: "http://foo.bar"
8081
});
8182

8283
before(function () {

0 commit comments

Comments
 (0)