config.js 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. process.env.NODE_ENV = 'test';
  2. const config = require('../config');
  3. let server = require('../app');
  4. let chai = require('chai');
  5. const fs = require('fs');
  6. const {
  7. expect
  8. } = require('chai');
  9. const {
  10. response
  11. } = require('express');
  12. let should = chai.should();
  13. describe('Config.js', () => {
  14. /*
  15. * Test the /GET route
  16. */
  17. describe('twilio INFORMATIONS', () => {
  18. it('checking the twilio logins using the api : should allow to use it', () => {
  19. let login = config.accountSid.startsWith('AC');
  20. let pass = !!config.authToken;
  21. login.should.equal(true);
  22. pass.should.equal(true);
  23. });
  24. });
  25. describe('api INFORMATIONS', () => {
  26. it('check the api password', () => {
  27. let length = config.apipassword.length > 16;
  28. config.apipassword.should.not.equal('4ZMSTeSpX8FD9er9ymNKAHUms74fFjAf');
  29. length.should.equal(true);
  30. });
  31. });
  32. describe('services FILEPATH', () => {
  33. it('check the services FILEPATH and if the files exists', () => {
  34. let services = ['amazon', 'cdiscount', 'twitter', 'whatsapp', 'paypal', 'google', 'snapchat', 'instagram', 'facebook', 'end', 'default'];
  35. services.forEach(e => {
  36. fs.existsSync(config[e + 'filepath']).should.equal(true);
  37. });
  38. });
  39. });
  40. });