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.

17 lines
933 B

4 years ago
  1. 'use strict';
  2. var inspect = require('../');
  3. var test = require('tape');
  4. test('quoteStyle option', function (t) {
  5. t['throws'](function () { inspect(null, { quoteStyle: false }); }, 'false is not a valid value');
  6. t['throws'](function () { inspect(null, { quoteStyle: true }); }, 'true is not a valid value');
  7. t['throws'](function () { inspect(null, { quoteStyle: '' }); }, '"" is not a valid value');
  8. t['throws'](function () { inspect(null, { quoteStyle: {} }); }, '{} is not a valid value');
  9. t['throws'](function () { inspect(null, { quoteStyle: [] }); }, '[] is not a valid value');
  10. t['throws'](function () { inspect(null, { quoteStyle: 42 }); }, '42 is not a valid value');
  11. t['throws'](function () { inspect(null, { quoteStyle: NaN }); }, 'NaN is not a valid value');
  12. t['throws'](function () { inspect(null, { quoteStyle: function () {} }); }, 'a function is not a valid value');
  13. t.end();
  14. });