Skip to content
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
2 changes: 2 additions & 0 deletions .talismanrc
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,6 @@ fileignoreconfig:
checksum: db8bc45f6d8aa3daebae621920c8618b6e23d1a20984dee0749d91bfa5c1530c
- filename: test/unit/base-command.test.ts
checksum: 4612c2a41c9d5a7af887f77842feee0a6f6a28ba95a094282b5e9aa20dba6c8c
- filename: src/adapters/base-class.ts
checksum: 75753f8762fc2fd3810672e7070bbdd48b152ec1ad90b18eb1ad5c817a9705aa
version: "1.0"
13 changes: 9 additions & 4 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,15 @@
Integration tests (`test/integration/`) exist to catch what unit tests cannot: they run a
real oclif command end to end and assert on what the CLI *does*.
- Run them with `npm run test:integration` (they are also part of `npm test`).
- Only three things are replaced: the terminal prompt (`inquirer`), the `open` package, and
the Contentstack management SDK, which resolves its base URL as `https://<host>:443` and so
cannot be pointed at a local server. Apollo, the GraphQL documents, the CLI config store,
flag parsing, the filesystem and `git` all run for real.
- Only these are replaced: the terminal prompt (`inquirer`), the browser opener
(`src/util/open-url`; the CLI never imports the `open` package directly, so mocking `open` has no
effect), `@oclif/core`'s `getPlatform` (it runs a native `import('wsl-utils')` that Jest's VM
cannot execute), and the Contentstack management SDK, which resolves its base URL as
`https://<host>:443` and so cannot be pointed at a local server. Apollo, the GraphQL documents,
the CLI config store, flag parsing, the filesystem and `git` all run for real.
- `jest.global-setup.ts` clears git's repo-local environment variables (`git rev-parse
--local-env-vars`). Git exports them to hooks, and the pre-push hook runs this suite; left set,
the harness's git calls in its temp projects would act on this repository instead.
- The Launch API is a local HTTP server (`test/integration/harness/launch-api.ts`) that the CLI
reaches through a temporary region config. It records every GraphQL operation, so tests assert
on the operations and variables the CLI actually sent rather than on internal method calls.
Expand Down
Loading
Loading