Skip to content

Commit

Permalink
Use @nx.js/inspect for REPL tests
Browse files Browse the repository at this point in the history
  • Loading branch information
TooTallNate committed Dec 19, 2024
1 parent 5e28f7e commit 72e752d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
1 change: 1 addition & 0 deletions packages/repl/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
"sisteransi": "^1.0.5"
},
"devDependencies": {
"@nx.js/inspect": "workspace:*",
"@nx.js/runtime": "workspace:*",
"vite": "^5.4.2",
"vitest": "^2.0.5"
Expand Down
12 changes: 5 additions & 7 deletions packages/repl/test/repl.test.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
import util from 'node:util';
import { createInspect } from '@nx.js/inspect';
import { describe, expect, test } from 'vitest';
import { REPL, type REPLOptions } from '../src/index';

const encoder = new TextEncoder();

const opts: REPLOptions = {
inspect(v: unknown): string {
return util.inspect(v);
},
inspect: createInspect(),
};

describe('REPL', () => {
Expand Down Expand Up @@ -61,10 +59,10 @@ describe('REPL', () => {

chunk = await reader.read();
expect(chunk.value).toMatchInlineSnapshot(`
"2
"[1m[33m2[39m[22m
"
`);
"
`);

expect(globalThis._).toBe(2);
});
Expand Down
3 changes: 3 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 72e752d

Please sign in to comment.