Sha256: 8c9e14bd85d0207d802fe0b0448e77cb57d8c7adf57c22e3c451ae125517c06f

Contents?: true

Size: 768 Bytes

Versions: 7

Compression:

Stored size: 768 Bytes

Contents

var test = require('tap').test

var normalize = require('../')
var fixer = normalize.fixer

test('mixedcase', function (t) {
  t.doesNotThrow(function () {
    fixer.fixNameField({name: 'foo'}, true)
  })

  t.doesNotThrow(function () {
    fixer.fixNameField({name: 'foo'}, false)
  })

  t.doesNotThrow(function () {
    fixer.fixNameField({name: 'foo'})
  })

  t.throws(function () {
    fixer.fixNameField({name: 'Foo'}, true)
  }, new Error('Invalid name: "Foo"'), 'should throw an error')

  t.throws(function () {
    fixer.fixNameField({name: 'Foo'}, {strict: true})
  }, new Error('Invalid name: "Foo"'), 'should throw an error')

  t.doesNotThrow(function () {
    fixer.fixNameField({name: 'Foo'}, {strict: true, allowLegacyCase: true})
  })

  t.end()
})

Version data entries

7 entries across 6 versions & 3 rubygems

Version Path
lanes-0.8.0 node_modules/normalize-package-data/test/mixedcase-names.js
node-compiler-0.9.1 vendor/node/deps/npm/node_modules/normalize-package-data/test/mixedcase-names.js
node-compiler-0.9.0 vendor/node-v7.2.1/deps/npm/node_modules/normalize-package-data/test/mixedcase-names.js
node-compiler-0.8.0 vendor/node-v7.2.0/deps/npm/node_modules/normalize-package-data/test/mixedcase-names.js
node-compiler-0.7.0 vendor/node-v7.1.0/deps/npm/node_modules/normalize-package-data/test/mixedcase-names.js
node-compiler-0.7.0 vendor/node-v6.9.1/deps/npm/node_modules/normalize-package-data/test/mixedcase-names.js
blackboard-3.1.9 lib/site_template/node_modules/normalize-package-data/test/mixedcase-names.js