Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test packages #436

Merged
merged 13 commits into from
Aug 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/workflows/ci_test_workspace.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,10 @@ jobs:
- name: Fix lightningcss windows
if: runner.os == 'Windows'
run: npm install lightningcss-win32-x64-msvc
- name: Run package tests
run: npm run packages:test
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Run workspace tests
run: npm run workspace:test
env:
Expand Down
14 changes: 10 additions & 4 deletions dist/jsenv_core.js
Original file line number Diff line number Diff line change
Expand Up @@ -2915,13 +2915,19 @@ const applyAssociations = ({ url, associations }) => {
};

const deepAssign = (firstValue, secondValue) => {
if (!isPlainObject(firstValue) || !isPlainObject(secondValue)) {
if (!isPlainObject(firstValue)) {
if (isPlainObject(secondValue)) {
return deepAssign({}, secondValue);
}
return secondValue;
}
if (!isPlainObject(secondValue)) {
return secondValue;
}
for (const key of Object.keys(secondValue)) {
const leftValue = firstValue[key];
const rightValue = secondValue[key];
firstValue[key] = deepAssign(leftValue, rightValue);
const leftPopertyValue = firstValue[key];
const rightPropertyValue = secondValue[key];
firstValue[key] = deepAssign(leftPopertyValue, rightPropertyValue);
}
return firstValue;
};
Expand Down
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@jsenv/core",
"version": "39.5.0",
"version": "39.5.1",
"description": "Tool to develop, test and build js projects",
"license": "MIT",
"author": {
Expand Down Expand Up @@ -47,7 +47,7 @@
"eslint": "npx eslint .",
"test": "node --conditions=development ./scripts/test/test.mjs",
"build": "node --conditions=development ./scripts/build/build.mjs",
"workspace:test": "npm run test --workspaces --if-present -- --workspace",
"packages:test": "npm run test -- ./packages/",
"workspace:build": "npm run build --workspaces --if-present --conditions=developement",
"monorepo:sync_packages_versions": "node ./scripts/monorepo/sync_packages_versions.mjs",
"monorepo:publish": "node ./scripts/monorepo/publish_packages.mjs",
Expand All @@ -70,20 +70,20 @@
"@financial-times/polyfill-useragent-normaliser": "1.10.2",
"@jsenv/abort": "4.3.0",
"@jsenv/ast": "6.2.17",
"@jsenv/filesystem": "4.10.2",
"@jsenv/filesystem": "4.10.3",
"@jsenv/humanize": "1.2.8",
"@jsenv/importmap": "1.2.1",
"@jsenv/integrity": "0.0.2",
"@jsenv/js-module-fallback": "1.3.38",
"@jsenv/node-esm-resolution": "1.0.6",
"@jsenv/plugin-bundling": "2.7.7",
"@jsenv/plugin-bundling": "2.7.8",
"@jsenv/plugin-minification": "1.5.5",
"@jsenv/plugin-supervisor": "1.5.19",
"@jsenv/plugin-transpilation": "1.4.22",
"@jsenv/runtime-compat": "1.3.1",
"@jsenv/server": "15.3.0",
"@jsenv/server": "15.3.1",
"@jsenv/sourcemap": "1.2.23",
"@jsenv/url-meta": "8.5.1",
"@jsenv/url-meta": "8.5.2",
"@jsenv/urls": "2.5.2",
"@jsenv/utils": "2.1.2",
"string-width": "7.2.0",
Expand Down
5 changes: 1 addition & 4 deletions packages/independent/abort/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,5 @@
},
"files": [
"/src/"
],
"scripts": {
"test": "node --conditions=development ./scripts/test.mjs"
}
]
}
26 changes: 0 additions & 26 deletions packages/independent/abort/scripts/test.mjs

This file was deleted.

1 change: 0 additions & 1 deletion packages/independent/assert/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
"sideEffects": false,
"scripts": {
"dev": "node ./scripts/start_dev_server.mjs",
"test": "node ./scripts/test.mjs",
"eslint": "npx eslint . --ext=.js,.mjs,.cjs,.html",
"build": "node ./scripts/build.mjs",
"prepublishOnly": "npm run build"
Expand Down
13 changes: 0 additions & 13 deletions packages/independent/assert/scripts/test.mjs

This file was deleted.

8 changes: 1 addition & 7 deletions packages/independent/custom-elements-redefine/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,5 @@
"main": "./src/main.js",
"files": [
"/src/"
],
"scripts": {
"dev": "node ./scripts/dev.mjs",
"test": "node ./scripts/test.mjs"
},
"dependencies": {},
"devDependencies": {}
]
}
10 changes: 0 additions & 10 deletions packages/independent/custom-elements-redefine/scripts/dev.mjs

This file was deleted.

25 changes: 0 additions & 25 deletions packages/independent/custom-elements-redefine/scripts/test.mjs

This file was deleted.

3 changes: 0 additions & 3 deletions packages/independent/dynamic-import-worker/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,5 @@
"files": [
"/src/"
],
"scripts": {
"test": "node ./scripts/test.mjs"
},
"dependencies": {}
}
12 changes: 0 additions & 12 deletions packages/independent/dynamic-import-worker/scripts/test.mjs

This file was deleted.

1 change: 0 additions & 1 deletion packages/independent/eslint-config/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
"/babel.config.cjs"
],
"scripts": {
"test": "node ./scripts/test.mjs",
"build": "node ./scripts/build.mjs",
"prepublishOnly": "npm run build"
},
Expand Down
13 changes: 0 additions & 13 deletions packages/independent/eslint-config/scripts/test.mjs

This file was deleted.

1 change: 0 additions & 1 deletion packages/independent/eslint-import-resolver/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
"/src/"
],
"scripts": {
"test": "node --conditions=development ./scripts/test.mjs",
"build": "node --experimental-import-meta-resolve ./scripts/build.mjs",
"prepublishOnly": "npm run build"
},
Expand Down
13 changes: 0 additions & 13 deletions packages/independent/eslint-import-resolver/scripts/test.mjs

This file was deleted.

7 changes: 2 additions & 5 deletions packages/independent/exception/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@jsenv/exception",
"version": "1.1.2",
"version": "1.1.3",
"description": "Error and throw value wrapper",
"license": "MIT",
"author": {
Expand Down Expand Up @@ -29,11 +29,8 @@
"files": [
"/src/"
],
"scripts": {
"test": "node --conditions=development ./scripts/test.mjs"
},
"dependencies": {
"@jsenv/url-meta": "8.5.1",
"@jsenv/url-meta": "8.5.2",
"errorstacks": "2.4.1"
}
}
13 changes: 0 additions & 13 deletions packages/independent/exception/scripts/test.mjs

This file was deleted.

7 changes: 2 additions & 5 deletions packages/independent/fetch/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@jsenv/fetch",
"version": "1.1.73",
"version": "1.1.74",
"description": "Unified url fetcher (http, http, file, data)",
"license": "MIT",
"author": {
Expand Down Expand Up @@ -31,12 +31,9 @@
"files": [
"/src/"
],
"scripts": {
"test": "node --conditions=development ./scripts/test.mjs"
},
"dependencies": {
"@jsenv/urls": "2.5.2",
"@jsenv/server": "15.3.0",
"@jsenv/server": "15.3.1",
"node-fetch": "3.3.2"
}
}
13 changes: 0 additions & 13 deletions packages/independent/fetch/scripts/test.mjs

This file was deleted.

7 changes: 2 additions & 5 deletions packages/independent/filesystem/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@jsenv/filesystem",
"version": "4.10.2",
"version": "4.10.3",
"license": "MIT",
"repository": {
"type": "git",
Expand Down Expand Up @@ -28,12 +28,9 @@
"files": [
"/src/"
],
"scripts": {
"test": "node --conditions=development ./scripts/test.mjs"
},
"dependencies": {
"@jsenv/urls": "2.5.2",
"@jsenv/url-meta": "8.5.1",
"@jsenv/url-meta": "8.5.2",
"@jsenv/abort": "4.3.0",
"@jsenv/utils": "2.1.2"
}
Expand Down
13 changes: 0 additions & 13 deletions packages/independent/filesystem/scripts/test.mjs

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import { assert } from "@jsenv/assert";
import { resolveUrl } from "@jsenv/urls";

import {
ensureEmptyDirectory,
moveEntry,
Expand All @@ -10,6 +8,7 @@ import {
writeFile,
} from "@jsenv/filesystem";
import { wait } from "@jsenv/filesystem/tests/testHelpers.js";
import { resolveUrl } from "@jsenv/urls";

const tempDirectoryUrl = resolveUrl("./temp/", import.meta.url);
await ensureEmptyDirectory(tempDirectoryUrl);
Expand Down Expand Up @@ -136,12 +135,13 @@ await ensureEmptyDirectory(tempDirectoryUrl);
removed: () => {
mutations.push({ type: "removed" });
},
cooldownBetweenFileEvents: 200,
keepProcessAlive: false,
});
await writeFile(fileUrl);
await wait(200);
await wait(500);
await moveEntry({ from: fileUrl, to: destinationUrl });
await wait(200);
await wait(500);
const actual = mutations;
const expect = [{ type: "added" }, { type: "removed" }];
assert({ actual, expect });
Expand Down
Loading
Loading