DeleteOldFilesTest.js 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. const Client = require('./helpers/Client')
  2. const ClsiApp = require('./helpers/ClsiApp')
  3. describe('Deleting Old Files', function () {
  4. before(async function () {
  5. this.request = {
  6. resources: [
  7. {
  8. path: 'main.tex',
  9. content: `\
  10. \\documentclass{article}
  11. \\begin{document}
  12. Hello world
  13. \\end{document}\
  14. `,
  15. },
  16. ],
  17. }
  18. await ClsiApp.ensureRunning()
  19. })
  20. describe('on first run', function () {
  21. before(async function () {
  22. this.project_id = Client.randomId()
  23. this.body = await Client.compile(this.project_id, this.request)
  24. })
  25. it('should return a success status', function () {
  26. this.body.compile.status.should.equal('success')
  27. })
  28. describe('after file has been deleted', function () {
  29. before(async function () {
  30. this.request.resources = []
  31. this.body = await Client.compile(this.project_id, this.request)
  32. })
  33. it('should return a failure status', function () {
  34. this.body.compile.status.should.equal('failure')
  35. })
  36. })
  37. })
  38. })