op-js
op-js copied to clipboard
Consider account requirements on a per suite/test basis
Problems
- Some suites, for example
eventsApi.test.ts
, require that the active account selected in the CLI is a Teams or Business account - We may want to test behaviour when there is no active account selected in the CLI
In both of these instances we encounter problems because jest.setup.ts
forces the suites to sign in as the account configured in the OP_ACCOUNT
env variable. The configured account may not be a Teams or Business account, and forcing this sign in precludes us from testing signed out behaviour.
Thoughts
- Can we create helpers for
op signin
andop signout
that we use on a per suite/test basis to configure the CLI as we need it for the specific tests, and remove thesetGlobalFlags
call fromjest.setup.ts
? - Do we need separate env variables for each account type for testing functionality available only to specific account types? if so, how does this affect external contributors who cannot create 1Password accounts at will?