server-tests.js 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. function equals(a, b) {
  2. return !!(EJSON.stringify(a) === EJSON.stringify(b));
  3. }
  4. Tinytest.add('cfs-filesystem - server - test environment', function(test) {
  5. test.isTrue(typeof FS.Collection !== 'undefined', 'test environment not initialized FS.Collection');
  6. test.isTrue(typeof CFSErrorType !== 'undefined', 'test environment not initialized CFSErrorType');
  7. });
  8. /*
  9. * FS.File Server Tests
  10. *
  11. * construct FS.File with no arguments
  12. * load data with FS.File.setDataFromBuffer
  13. * load data with FS.File.setDataFromBinary
  14. * load data and then call FS.File.toDataUrl with and without callback
  15. * load buffer into FS.File and then call FS.File.getBinary with and without start/end; make sure correct data is returned
  16. * construct FS.File, set FS.File.collectionName to a CFS name, and then test FS.File.update/remove/get/put/del/url
  17. * (call these with and without callback to test sync vs. async)
  18. * set FS.File.name to a filename and test that FS.File.getExtension() returns the extension
  19. *
  20. *
  21. * FS.Collection Server Tests
  22. *
  23. * Make sure options.filter is respected
  24. *
  25. *
  26. */
  27. //Test API:
  28. //test.isFalse(v, msg)
  29. //test.isTrue(v, msg)
  30. //test.equalactual, expected, message, not
  31. //test.length(obj, len)
  32. //test.include(s, v)
  33. //test.isNaN(v, msg)
  34. //test.isUndefined(v, msg)
  35. //test.isNotNull
  36. //test.isNull
  37. //test.throws(func)
  38. //test.instanceOf(obj, klass)
  39. //test.notEqual(actual, expected, message)
  40. //test.runId()
  41. //test.exception(exception)
  42. //test.expect_fail()
  43. //test.ok(doc)
  44. //test.fail(doc)
  45. //test.equal(a, b, msg)