helper.test.js 456 B

1234567891011121314151617181920212223242526
  1. var helper = require("../../lib/helper.js");
  2. var should = require("should");
  3. describe('Helper', function () {
  4. const fixt = {
  5. a : {
  6. b : {
  7. c : 'result'
  8. }
  9. }
  10. }
  11. describe('.get', () => {
  12. should(helper.get(fixt, 'a.b.c')).eql('result')
  13. })
  14. describe('.get null', () => {
  15. should(helper.get(null, 'a.b.c')).eql(null)
  16. })
  17. describe('.get null', () => {
  18. should(helper.get(fixt, 'a.b.d')).eql(undefined)
  19. })
  20. })