1 var test = require('tap').test
3 var normalize = require('../')
4 var fixer = normalize.fixer
6 test('mixedcase', function (t) {
7 t.doesNotThrow(function () {
8 fixer.fixNameField({name: 'foo'}, true)
11 t.doesNotThrow(function () {
12 fixer.fixNameField({name: 'foo'}, false)
15 t.doesNotThrow(function () {
16 fixer.fixNameField({name: 'foo'})
19 t.throws(function () {
20 fixer.fixNameField({name: 'Foo'}, true)
21 }, new Error('Invalid name: "Foo"'), 'should throw an error')
23 t.throws(function () {
24 fixer.fixNameField({name: 'Foo'}, {strict: true})
25 }, new Error('Invalid name: "Foo"'), 'should throw an error')
27 t.doesNotThrow(function () {
28 fixer.fixNameField({name: 'Foo'}, {strict: true, allowLegacyCase: true})