Ver Fonte

fix: test issues from contextlink removal

Apparently there were two things:
- had to remove contextlink from the test command (that was expected)
- can't import libs from putility in the test environment. The error
  produced for this doesn't really explain why.
KernelDeimos há 5 meses atrás
pai
commit
545e7db5bd

+ 1 - 1
package.json

@@ -28,7 +28,7 @@
     "webpack-cli": "^5.1.1"
     "webpack-cli": "^5.1.1"
   },
   },
   "scripts": {
   "scripts": {
-    "test": "npx mocha src/phoenix/test src/contextlink/test && node src/backend/tools/test",
+    "test": "npx mocha src/phoenix/test && node src/backend/tools/test",
     "start=gui": "nodemon --exec \"node dev-server.js\" ",
     "start=gui": "nodemon --exec \"node dev-server.js\" ",
     "start": "node ./tools/run-selfhosted.js",
     "start": "node ./tools/run-selfhosted.js",
     "build": "cd src/gui; node ./build.js",
     "build": "cd src/gui; node ./build.js",

+ 2 - 2
src/phoenix/src/util/statemachine.js

@@ -17,8 +17,8 @@
  * along with this program.  If not, see <https://www.gnu.org/licenses/>.
  * along with this program.  If not, see <https://www.gnu.org/licenses/>.
  */
  */
 import { disallowAccessToUndefined } from "./lang.js";
 import { disallowAccessToUndefined } from "./lang.js";
-import { libs } from '@heyputer/putility';
-const { Context } = libs.context;
+import putility from '@heyputer/putility';
+const { Context } = putility.libs.context;
 
 
 export class StatefulProcessor {
 export class StatefulProcessor {
     constructor (params) {
     constructor (params) {

+ 2 - 2
src/phoenix/test/coreutils/harness.js

@@ -16,8 +16,8 @@
  * You should have received a copy of the GNU Affero General Public License
  * You should have received a copy of the GNU Affero General Public License
  * along with this program.  If not, see <https://www.gnu.org/licenses/>.
  * along with this program.  If not, see <https://www.gnu.org/licenses/>.
  */
  */
-import { libs } from '@heyputer/putility';
-const { Context } = libs.context;
+import putility from '@heyputer/putility';
+const { Context } = putility.libs.context;
 import { SyncLinesReader } from '../../src/ansi-shell/ioutil/SyncLinesReader.js';
 import { SyncLinesReader } from '../../src/ansi-shell/ioutil/SyncLinesReader.js';
 import { CommandStdinDecorator } from '../../src/ansi-shell/pipeline/iowrappers.js';
 import { CommandStdinDecorator } from '../../src/ansi-shell/pipeline/iowrappers.js';
 import { ReadableStream, WritableStream } from 'stream/web'
 import { ReadableStream, WritableStream } from 'stream/web'