lundi 14 septembre 2020

Should I use the fixture to import JSON in Cypress?

I'm testing a React project by Cypress.

I saw an document in Cypress website which say 'use fixture to import JSON and etc'.

Images or different file formats seems need fixture to yield, but should I use it also on JSON?

I tried import dummyData from '../some-where/something.json' and it works. Most JSON files are less than 5kb in size.

I want to place individual JSON data in the same folder with test code for easy finding. (not in the fixture folder)

I wonder are there any issues if I use this to import.

Could you share any advice for me?

Thanks

Aucun commentaire:

Enregistrer un commentaire