Read text file from spec folder


What’s the correct way of using a text file on a spec?

I won’t be testing the package’s editor features but some parsing done by coffeescript.

Is there a way to read a text file in the specs folder directly into coffeescript?
Should I programmatically open it on the editor? Or must I embed it in a string on the coffee file?


For bundled default plugin, you’ll some with a fixtures folder. Those are used to test file system, either listing file within a folder or testing inside a typical code file.

Then it’s accessed with something like

or this

Finally if you have a lot of small text to apply test, you can use setText