Closed koudaiii closed 1 month ago
see #21
$ npm run test:unit
> jp-learn-microsoft-com-update-checker@1.2.0 test:unit
> jest tests/unit
(node:25042) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
PASS tests/unit/content.test.js
URL Check in Content Script
✓ should only run script if URL starts with https://learn.microsoft.com/ja-jp/ (2 ms)
✓ should not run script if URL does not start with https://learn.microsoft.com/ja-jp/
Test Suites: 1 passed, 1 total
Tests: 2 passed, 2 total
Snapshots: 0 total
Time: 1.644 s
Ran all test suites matching /tests\/unit/i.
$ npm run test:e2e
> jp-learn-microsoft-com-update-checker@1.2.0 test:e2e
> jest tests/e2e
PASS tests/e2e/content.e2e.test.js (16.342 s)
JP Learn Microsoft.com Update Checker E2E Test
✓ should display English update date on https://learn.microsoft.com/ja-jp/azure/virtual-machines/overview with dark theme in dark mode (2050 ms)
✓ should not run script on en-us pages with dark theme in dark mode (388 ms)
✓ should display English update date on https://learn.microsoft.com/ja-jp/azure/virtual-machines/overview with dark theme in light mode (1234 ms)
✓ should not run script on en-us pages with dark theme in light mode (191 ms)
✓ should display English update date on https://learn.microsoft.com/ja-jp/azure/virtual-machines/overview with light theme in dark mode (1209 ms)
✓ should not run script on en-us pages with light theme in dark mode (163 ms)
✓ should display English update date on https://learn.microsoft.com/ja-jp/azure/virtual-machines/overview with light theme in light mode (1196 ms)
✓ should not run script on en-us pages with light theme in light mode (168 ms)
✓ should display English update date on https://learn.microsoft.com/ja-jp/azure/virtual-machines/overview with high-contrast theme in dark mode (1199 ms)
✓ should not run script on en-us pages with high-contrast theme in dark mode (177 ms)
✓ should display English update date on https://learn.microsoft.com/ja-jp/azure/virtual-machines/overview with high-contrast theme in light mode (1221 ms)
✓ should not run script on en-us pages with high-contrast theme in light mode (161 ms)
✓ should display English update date on https://learn.microsoft.com/zh-cn/azure/virtual-machines/overview with light theme in light mode (1673 ms)
✓ should not run script on en-us pages with light theme in light mode (162 ms)
✓ should run script with jp-learn-microsoft-com-update-checker-debug flag (708 ms)
Test Suites: 1 passed, 1 total
Tests: 15 passed, 15 total
Snapshots: 0 total
Time: 16.393 s
Ran all test suites matching /tests\/e2e/i.
This pull request includes a minor change to the
manifest.json
file. The change broadens the scope of the content script to include all locales of the Microsoft Learn website, rather than just the Japanese locale.manifest.json
: Updated thematches
pattern to apply the content script to all locales of the Microsoft Learn website.