Meteor-files: Best way to add test files during a chimp test

Created on 26 Jun 2018  路  3Comments  路  Source: veliovgroup/Meteor-Files

I have been looking through the documentation and I am having trouble generating test files on the server for my tests.

If I try to do it on the client I get a bunch of errors about how different things are defined, and if I do it in a server method I get an error saying "insert" is not defined.

So is there a way to insert a file directly into the collection on the server?

I want to insert one empty file, and one file from a relative path so that I can use them in my tests.

question

Most helpful comment

Sorry for the late response. addFile is exactly what I wanted, thanks!

All 3 comments

Hello @schlaegerz ,

I'm very sorry for the late reply 馃檹馃徎.
Yes, there is __no__ method .insert() __on__ Server, as .insert() is __the upload__, and possible only from Client to Server. I recommend to take a look on .write() and .addFile() methods.

Let me know wdyt.

Closed due to silence at issue owner end.
Feel free to reopen it in case if the issue still persists on your end.

Sorry for the late response. addFile is exactly what I wanted, thanks!

Was this page helpful?
0 / 5 - 0 ratings