1
0

index.js 873 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. import test from 'ava';
  2. import Hydrawise from '../lib/hydrawise';
  3. const hydrawise = new Hydrawise('53DC-7E24-07E8-CD7D');
  4. test('Customer Details', t => {
  5. return hydrawise.customerdetails().then(data => {
  6. if (data.error_msg) {
  7. t.fail(`Error: ${data.error_msg}`);
  8. }
  9. t.pass();
  10. });
  11. });
  12. test('Status Schedule', t => {
  13. return hydrawise.statusschedule().then(data => {
  14. if (data.error_msg) {
  15. t.fail(`Error: ${data.error_msg}`);
  16. }
  17. t.pass();
  18. });
  19. });
  20. test('Status Schedule All', t => {
  21. return hydrawise.statusschedule('hydrawise_all').then(data => {
  22. if (data.error_msg) {
  23. t.fail(`Error: ${data.error_msg}`);
  24. }
  25. t.pass();
  26. });
  27. });
  28. test('Set Controller', t => {
  29. return hydrawise.setcontroller('11742').then(data => {
  30. if (data.error_msg) {
  31. t.fail(`Error: ${data.error_msg}`);
  32. }
  33. t.pass();
  34. });
  35. });