Open czerwinskilukasz1 opened 4 years ago
This is NOT a duplicate of https://github.com/xFAANG/askql/issues/166 or https://github.com/xFAANG/askql/issues/154
Let's fix npm run ask <.ask file path>
. It should print results regardless of whether there is expected result for that file or not. The bug is in implementation of https://github.com/xFAANG/askql/blob/aefa51797af19af36c001c529b962374dddf69b2/src/test.jest.testRunner.ts#L199
If a user wanted to run their .ask file, they can use CLI or Playground and copy-paste the source code, which is inconvenient. Moreover, these methods don't support ask() arguments. Another way is to run
npm run ask <.ask file path>
, but this command would only execute a script if user created also a file with expected return value. Moreover, if the user doesn't guess correctly the expected return value, they would get a nasty error from jest:The task is to propose and write a command which will accept a file path to an .ask file and ask() arguments, and print the result. It is up to discussion whether the ask() arguments should be provided from command line or rather from a separate file.