-
Notifications
You must be signed in to change notification settings - Fork 1
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
Support field type #3
Changes from 7 commits
9083f1a
16926bc
865e347
5fc1b35
ae848c8
9aa0791
56e964d
f26f1f7
8577a48
ee4cb61
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@forgerock/davinci-client': minor | ||
--- | ||
|
||
adding support for fields in DROPDOWN, CHECKBOX, COMBOBOX, RADIO, FLOW_LINK. |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -76,7 +76,7 @@ jobs: | |
NPM_TOKEN: ${{ secrets.NPM_ACCESS_TOKEN }} | ||
|
||
- name: Send GitHub Action data to a Slack workflow | ||
if: steps.changesets.outputs.published === 'true' | ||
if: steps.changesets.outputs.published == 'true' | ||
uses: slackapi/[email protected] | ||
with: | ||
payload-delimiter: '_' | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# Testing | ||
|
||
## Testing Types | ||
|
||
You can test types using vitest. It's important to note that testing types does not actually _run_ a test file. | ||
|
||
When you test types, these are statically analyzed by the compiler. | ||
|
||
Vitest defaults state that all files matching `*.test-d.ts` are considered type-tests | ||
|
||
From the vitest docs: | ||
|
||
``` | ||
Under the hood Vitest calls tsc or vue-tsc, depending on your config, and parses results. Vitest will also print out type errors in your source code, if it finds any. You can disable it with typecheck.ignoreSourceErrors config option. | ||
|
||
Keep in mind that Vitest doesn't run these files, they are only statically analyzed by the compiler. Meaning, that if you use a dynamic name or test.each or test.for, the test name will not be evaluated - it will be displayed as is. | ||
``` |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -57,7 +57,10 @@ export async function davinci({ config }: { config: DaVinciConfig }) { | |
if (!action.action) { | ||
console.error('Missing `argument.action`'); | ||
return async function () { | ||
return { error: { message: 'Missing argument.action', type: 'argument_error' } }; | ||
return { | ||
error: { message: 'Missing argument.action', type: 'argument_error' }, | ||
type: 'internal_error', | ||
}; | ||
}; | ||
} | ||
|
||
|
@@ -107,6 +110,7 @@ export async function davinci({ config }: { config: DaVinciConfig }) { | |
return function () { | ||
return { | ||
error: { message: 'Argument for `collector` has no ID', type: 'argument_error' }, | ||
type: 'internal_error', | ||
}; | ||
}; | ||
} | ||
|
@@ -118,6 +122,7 @@ export async function davinci({ config }: { config: DaVinciConfig }) { | |
return function () { | ||
console.error('Collector not found'); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. obviously this was here, just want to make sure we want a console.error There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, we should probably talk about this. Ultimately, I think it's good we log errors when they happen, but we probably need to add a control for this sometime soon (like logLevel). And, we should be consistent with it. I think some instances of errors we don't log with |
||
return { | ||
type: 'internal_error', | ||
error: { message: 'Collector not found', type: 'state_error' }, | ||
}; | ||
}; | ||
|
@@ -127,6 +132,7 @@ export async function davinci({ config }: { config: DaVinciConfig }) { | |
console.error('Collector is not a SingleValueCollector and cannot be updated'); | ||
return function () { | ||
return { | ||
type: 'internal_error', | ||
error: { | ||
message: 'Collector is not a SingleValueCollector and cannot be updated', | ||
type: 'state_error', | ||
|
@@ -141,7 +147,10 @@ export async function davinci({ config }: { config: DaVinciConfig }) { | |
return null; | ||
} catch (err) { | ||
const error = err as Error; | ||
return { error: { message: error.message, type: 'internal_error' } }; | ||
return { | ||
type: 'internal_error', | ||
error: { message: error.message, type: 'internal_error' }, | ||
}; | ||
} | ||
}; | ||
}, | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ryanbas21 I'm sure you didn't intend to change this to something else?