CatchTheTornado / askql

AskQL is a query language that can express any data request
https://askql.org/
MIT License
387 stars 27 forks source link

Provide a way to execute an .ask file from command line, including arguments #248

Open czerwinskilukasz1 opened 4 years ago

czerwinskilukasz1 commented 4 years ago

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:

image

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.

czerwinskilukasz1 commented 4 years ago

This is NOT a duplicate of https://github.com/xFAANG/askql/issues/166 or https://github.com/xFAANG/askql/issues/154

mhagmajer commented 4 years ago

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