2

I have this test in adonis.js - node.js:

test('realiza login com o usuário registrado', async ({ client }) => {
  const response = await client
    .post('login')
    .send({
      username: 'usuarioteste',
      password: 'usuarioteste'
    })
    .end()

    response.assertStatus(200)

})

When i run adonis test i receive:

  Usuario
superagent: Enable experimental feature http2
    ✓ make a register (411ms)
    ✓ login (132ms)

   PASSED 

  total       : 2
  passed      : 2
  time        : 903ms

There's a way to export this log to a external file?

bla
  • 667
  • 4
  • 19
  • 1
    I'm not familiar with adonis.js or with your particular configuration, but the answer is probably "yes". Q: Can you look around your project directory and tell us 1) What unit test framework? 2) What test running? 3) Any related configuration files for your unit test runner? – paulsm4 Oct 30 '19 at 18:59
  • Unit test framework is vow: https://github.com/adonisjs/adonis-vow, there's no one config that specifies if i want to save the log... – bla Oct 30 '19 at 19:01
  • 1
    I looked at the GitHub link, and I didn't see anything "obvious". Strong suggestion: send an e-mail to the author. It appears he wrote each of a) the Adonis framework, b) your vow test runner, and c) the Japa framework vow was based on. He would probably know best. Good luck! – paulsm4 Oct 30 '19 at 19:11

1 Answers1

1

Please refer to this tutorial : https://www.windowscentral.com/how-save-command-output-file-using-command-prompt-or-powershell

In short:

You can save command output to file using this command (Linux & Windows) :

> adonis test > yourfile.txt
crbast
  • 1,750
  • 1
  • 7
  • 16
  • There's other extension that shows more readable? My txt don't show accents and special characters. I try to do a adonis test > yourfile.pdf but the pdf is broken... – bla Oct 30 '19 at 19:53
  • 1
    Sorry I have no idea. Please create a new stackoverflow question with powerhell tag (remove special char) – crbast Oct 30 '19 at 20:23
  • 1
    @Jhonny After some research the problem is not in the special characters but in the fact of creating a pdf from text content. The right question would be: `how to create a pdf from a text file with powershell`. – crbast Oct 31 '19 at 12:11