Software zum Installieren eines Smart-Mirror Frameworks , zum Nutzen von hochschulrelevanten Informationen, auf einem Raspberry-Pi.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

to-json.js 574B

1234567891011121314151617181920
  1. var test = require('tape');
  2. var stringify = require('../');
  3. test('toJSON function', function (t) {
  4. t.plan(1);
  5. var obj = { one: 1, two: 2, toJSON: function() { return { one: 1 }; } };
  6. t.equal(stringify(obj), '{"one":1}' );
  7. });
  8. test('toJSON returns string', function (t) {
  9. t.plan(1);
  10. var obj = { one: 1, two: 2, toJSON: function() { return 'one'; } };
  11. t.equal(stringify(obj), '"one"');
  12. });
  13. test('toJSON returns array', function (t) {
  14. t.plan(1);
  15. var obj = { one: 1, two: 2, toJSON: function() { return ['one']; } };
  16. t.equal(stringify(obj), '["one"]');
  17. });