File size: 659 Bytes
23ac194
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
'use strict'

const { test } = require('node:test')
const toCamelCase = require('../lib/toCamelCase')

test('from kebab-case to camelCase', (t) => {
  t.plan(1)
  t.assert.strictEqual(toCamelCase('hello-world'), 'helloWorld')
})

test('from @-prefixed named imports', (t) => {
  t.plan(1)
  t.assert.strictEqual(toCamelCase('@hello/world'), 'helloWorld')
})

test('from @-prefixed named kebab-case to camelCase', (t) => {
  t.plan(1)
  t.assert.strictEqual(toCamelCase('@hello/my-world'), 'helloMyWorld')
})

test('from kebab-case to camelCase multiple words', (t) => {
  t.plan(1)
  t.assert.strictEqual(toCamelCase('hello-long-world'), 'helloLongWorld')
})