Update formatting for errors and query info #808
Annotations
3 errors and 1 warning
/home/runner/work/fauna-shell/fauna-shell/test/commands/query.mjs.query v4 can output an error message:
test/commands/query.mjs#L474
expected stderr to have been called with arguments { test: [Function],
message: 'match("invalid argument: Database Ref or Null expected, String provided. at paginate, collections")' }
Call 1:
'"\\u001b[0mfauna query [fql]\\u001b[0m\\n\\u001b[0m\\u001b[0m\\n\\u001b[0mRun an FQL query.\\u001b[0m\\n\\u001b[0m\\u001b[0m\\n\\u001b[0mAPI:\\u001b[0m\\n\\u001b[0m --account-key Fauna account key used for authentication. Can\'t be used with --user or --secret. [string]\\u001b[0m\\n\\u001b[0m -u, --user CLI user to run the command as. You must first log in as the user using \'fauna login\'. [string] [default: \\"default\\"]\\u001b[0m\\n\\u001b[0m -r, --role Role used to run the command. Can\'t be used with --secret. [string]\\u001b[0m\\n\\u001b[0m -d, --database Database, including Region Group and hierarchy, to run the command in. Ex: \'us/my_db\', \'eu/parent_db/child_db\', \'global/db\'. [string]\\u001b[0m\\n\\u001b[0m --local Use a local Fauna container. Sets --url to \'http://0.0.0.0:8443\' and --secret to \'secret\'. [boolean] [default: false]\\u001b[0m\\n\\u001b[0m --url URL for Core HTTP API requests made by the command. Defaults to https://db.fauna.com. [string]\\u001b[0m\\n\\u001b[0m --secret Secret used for authentication. Can\'t be used with --database or --role. [string]\\u001b[0m\\n\\u001b[0m -v, --api-version FQL version to use. [string] [choices: \\"4\\", \\"10\\"] [default: \\"10\\"]\\u001b[0m\\n\\u001b[0m -f, --format Output format for the query. When present, --json takes precedence over --format. Only applies to v10 queries. [string] [choices: \\"fql\\", \\"json\\"] [default: \\"fql\\"]\\u001b[0m\\n\\u001b[0m --typecheck Enable typechecking. Defaults to the typechecking setting of the database. [boolean]\\u001b[0m\\n\\u001b[0m --timeout Maximum query runtime in milliseconds. Only applies to v10 queries. [number] [default: 5000]\\u001b[0m\\n\\u001b[0m --performance-hints Output performance hints. Sets --include summary. Only applies to v10 queries. If no performance hints are returned, no hints are output. [boolean] [default: false]\\u001b[0m\\n\\u001b[0m\\u001b[0m\\n\\u001b[0mPositionals:\\u001b[0m\\n\\u001b[0m fql FQL query to run. Use - to read from stdin. [string]\\u001b[0m\\n\\u001b[0m\\u001b[0m\\n\\u001b[0mOutput:\\u001b[0m\\n\\u001b[0m --color Enable color formatting. Use --no-color to disable. [boolean] [default: true]\\u001b[0m\\n\\u001b[0m --json Output the results as JSON. [boolean] [default: false]\\u001b[0m\\n\\u001b[0m --quiet Suppress all log messages except fatal errors. Overrides --verbosity and --verbose-component. [boolean] [default: false]\\u001b[0m\\n\\u001b[0m\\u001b[0m\\n\\u001b[0mConfig:\\u001b[0m\\n\\u001b[0m --config Path to a CLI config file to use. If provided, you must specify a profile. [string] [default: \\".\\"]\\u001b[0m\\n\\u001b[0m -p, --profile Profile from the CLI config file to use. [string]\\u001b[0m\\n\\u001b[0m\\u001b[0m\\n\\u001b[0mDebug:\\u001b[0m\\n\\u001b[0m --verbose-component Components to emit logs for. Overrides the --verbosity flag. Pass values as a space-separated list. Ex: --verbose-component fetch error. [array] [choices: \\"argv\\", \\"completion\\", \\"config\\", \\"creds\\", \\"error\\", \\"fetch\\"] [default: []]\\u001b[0m\\n\\u001b[0m --verbosity Least critical log level to emit. Accepts 1 (fatal) to 5 (debug). Lower values represent more critical logs. [number] [default: 0]\\u001b[0m\\n\\u001b[0m\\u001b[0m\\n\\u001b[0mOptions:\\u001b[0m\\n\\u001b[0m -h, --help Show help. [boolean]\\u001b[0m\\n\\u001b[0m --version Show the Fauna CLI version. [boolean]\\u001b[0m\\n\\u001b[0m --include Query response info to output. Pass values as a space-separated list. Ex: --include summary queryTags. [array] [choices: \\"all\\", \\"none\\", \\"txnTs\\", \\"schemaVersion\\", \\"summary\\", \\"queryTags\\", \\"stats\\"] [default: [\\"summary\\"]]\\u001b[0m\\n\\u001b[0m -i, --input Path to a file containing an FQL query to run. [string]\\u001b[0m\\n\\u001b[0m -o, --output Path to a file where query results are written. Defaults to stdout. [string]\\u001b[0m\\n\\u001b[0m\\u001b[0m\\n\\u001b[0mExamples:\\u001b[0m\\n\\u001b[0m fauna query \\"Collection.all()\\" --database us/my_db Run the query in the \'us/my_db\' database and write the results to stdout.\\u001b[0m\\n\\u001b[0m fauna query \\"Collection.all()\\" --database us/my_db --role server Run the query in the \'us/my_db\' database using the \'server\' role.\\u001b[0m\\n\\u001b[0m fauna query \\"Collection.all()\\" --secret my-secret Run the query in the database scoped to a secret.\\u001b[0m\\n\\u001b[0m fauna query -i /path/to/query.fql --database us/my_db Run the query from a file.\\u001b[0m\\n\\u001b[0m echo \\"1 + 1\\" | fauna query - --database us/my_db Run the query from stdin.\\u001b[0m\\n\\u001b[0m fauna query -i /path/to/query.fql --output /tmp/result.json --database us/my_db Run the query and write the results to a file.\\u001b[0m\\n\\n\\u001b[31mAn unexpected error occurred...\\u001b[39m\\n\\u001b[31m\\u001b[39m\\n\\u001b[31mCannot convert undefined or null to object\\u001b[39m"' match("invalid argument: Database Ref or Null expected, String provided. at paginate, collections")
Call 2:
'"\\u001b[31m\\u001b[39m\\n\\u001b[31mIf you believe this is a bug, please report this issue on GitHub: https://github.com/fauna/fauna-shell/issues\\u001b[39m"' match("invalid argument: Database Ref or Null expected, String provided. at paginate, collections")
|
/home/runner/work/fauna-shell/fauna-shell/test/lib/faunadb.mjs.faunadbToCommandError should convert BadRequest error to CommandError:
test/lib/faunadb.mjs#L44
expected [Function] to throw 'CommandError' but 'TypeError: Cannot convert undefined o…' was thrown
|
/home/runner/work/fauna-shell/fauna-shell/test/lib/faunadb.mjs.faunadbToCommandError should convert NotFound error to CommandError:
test/lib/faunadb.mjs#L56
expected [Function] to throw 'CommandError' but 'TypeError: Cannot convert undefined o…' was thrown
|
lint
ubuntu-latest pipelines will use ubuntu-24.04 soon. For more details, see https://github.com/actions/runner-images/issues/10636
|