Skip to content

Commit 9c07200

Browse files
authored
Add more unittests and package.json validation (WebKit#570)
- Add package validation (and fix versions identifiers in package.json files) - Add metrics unittests - Add basic translations data unittest
1 parent 779ca6f commit 9c07200

13 files changed

Lines changed: 1146 additions & 10 deletions

File tree

.github/workflows/test.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ jobs:
2626
- name: Install Node Packages
2727
run: npm ci
2828

29+
- name: Run package.json linter
30+
run: npm run lint:pkg
31+
2932
- name: Run linters
3033
run: npm run format
3134

.npmpackagejsonlintrc.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"extends": "npm-package-json-lint-config-default"
3+
}

package-lock.json

Lines changed: 902 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
"dev": "node tests/server.mjs",
1919
"lint:check": "eslint \"**/*.{js,mjs,jsx,ts,tsx}\"",
2020
"lint:fix": "eslint \"**/*.{js,mjs,jsx,ts,tsx}\" --fix",
21+
"lint:pkg": "npmPkgJsonLint \"**/package.json\" --ignore-pattern \"**/node_modules/**\"",
2122
"pretty:check": "prettier --check ./",
2223
"pretty:fix": "prettier --write ./",
2324
"format": "node tests/format.mjs",
@@ -55,6 +56,9 @@
5556
"lws-log": "^3.0.0",
5657
"lws-static": "^3.1.1",
5758
"mocha": "^10.2.0",
59+
"normalize-package-data": "^8.0.0",
60+
"npm-package-json-lint": "^10.4.1",
61+
"npm-package-json-lint-config-default": "^9.0.1",
5862
"prettier": "^2.8.3",
5963
"prettier-plugin-tailwindcss": "^0.4.1",
6064
"selenium-webdriver": "^4.44.0",

suites/newssite/news-nuxt/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
"name": "nuxt-app",
3+
"version": "1.0.0",
34
"private": true,
45
"scripts": {
56
"build": "node scripts/build.mjs",

suites/react-stockcharts/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
"name": "react-stockcharts-bench",
3+
"version": "1.0.0",
34
"private": true,
45
"scripts": {
56
"start": "react-scripts start",

suites/todomvc/architecture-examples/jquery-complex/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
"name": "todomvc-jquery-complex",
3+
"version": "1.0.0",
34
"private": true,
45
"scripts": {
56
"build": "node scripts/build.mjs",

suites/todomvc/architecture-examples/jquery/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
"name": "todomvc-jquery",
3+
"version": "1.0.0",
34
"private": true,
45
"scripts": {
56
"dev": "http-server . -p 7001 -c-1 --cors",

suites/todomvc/architecture-examples/lit-complex/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
"name": "lit-complex",
3+
"version": "1.0.0",
34
"private": true,
45
"engines": {
56
"node": ">=24.0.0",

suites/todomvc/architecture-examples/lit/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
"name": "todomvc-lit",
3+
"version": "1.0.0",
34
"private": true,
45
"type": "module",
56
"engines": {

0 commit comments

Comments
 (0)