Skip to content

Commit

Permalink
test(scaffold): update tests to expect 48 files instead of 19
Browse files Browse the repository at this point in the history
  • Loading branch information
esteban-url committed Dec 30, 2024
1 parent 0fc3c9b commit a853a9f
Show file tree
Hide file tree
Showing 9 changed files with 38 additions and 38 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ describe('in javascript (default) mode', () => {
})
})

test('returns exactly 19 files', async () => {
expect(Object.keys(files).length).toEqual(19)
test('returns exactly 48 files', async () => {
expect(Object.keys(files).length).toEqual(48)
})
// SDL

Expand Down Expand Up @@ -466,8 +466,8 @@ describe('in typescript mode', () => {
})
})

test('returns exactly 19 files', () => {
expect(Object.keys(tsFiles).length).toEqual(19)
test('returns exactly 48 files', () => {
expect(Object.keys(tsFiles).length).toEqual(48)
})

// SDL
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ describe('in javascript (default) mode', () => {
})
})

test('returns exactly 19 files', () => {
expect(Object.keys(files).length).toEqual(19)
test('returns exactly 48 files', () => {
expect(Object.keys(files).length).toEqual(48)
})
// SDL

Expand Down Expand Up @@ -308,8 +308,8 @@ describe('in typescript mode', () => {
})
})

test('returns exactly 19 files', () => {
expect(Object.keys(tsFiles).length).toEqual(19)
test('returns exactly 48 files', () => {
expect(Object.keys(tsFiles).length).toEqual(48)
})

// SDL
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ describe('admin/post', () => {
})

describe('creates the correct files with the correct imports', () => {
it('returns exactly 19 files', () => {
expect(Object.keys(filesLower).length).toEqual(19)
it('returns exactly 48 files', () => {
expect(Object.keys(filesLower).length).toEqual(48)
})

// Layout
Expand Down Expand Up @@ -359,8 +359,8 @@ describe('Admin/Post', () => {
})

describe('creates the correct files with the correct imports', () => {
it('returns exactly 19 files', () => {
expect(Object.keys(filesUpper).length).toEqual(19)
it('returns exactly 48 files', () => {
expect(Object.keys(filesUpper).length).toEqual(48)
})

// Layout
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ describe('admin/pages/post', () => {
})

describe('creates the correct files with the correct imports', () => {
test('returns exactly 19 files', () => {
expect(Object.keys(filesNestedLower).length).toEqual(19)
test('returns exactly 48 files', () => {
expect(Object.keys(filesNestedLower).length).toEqual(48)
})

// Layout
Expand Down Expand Up @@ -369,8 +369,8 @@ describe('Admin/Pages/Post/Post', () => {
})

describe('creates the correct files with the correct imports', () => {
test('returns exactly 19 files', () => {
expect(Object.keys(filesNestedUpper).length).toEqual(19)
test('returns exactly 48 files', () => {
expect(Object.keys(filesNestedUpper).length).toEqual(48)
})

// Layout
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ describe('admin/pages/post', () => {
})

describe('creates the correct files with the correct imports', () => {
test('returns exactly 19 files', () => {
expect(Object.keys(filesNestedLower).length).toEqual(19)
test('returns exactly 48 files', () => {
expect(Object.keys(filesNestedLower).length).toEqual(48)
})

// Layout
Expand Down Expand Up @@ -361,8 +361,8 @@ describe('Admin/Pages/Post/Post', () => {
})

describe('creates the correct files with the correct imports', () => {
test('returns exactly 19 files', () => {
expect(Object.keys(filesNestedUpper).length).toEqual(19)
test('returns exactly 48 files', () => {
expect(Object.keys(filesNestedUpper).length).toEqual(48)
})

// Layout
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ describe('AdminPages/Post', () => {
})

describe('creates the correct files with the correct imports', () => {
test('returns exactly 19 files', () => {
expect(Object.keys(filesMultiwordUpper).length).toEqual(19)
test('returns exactly 48 files', () => {
expect(Object.keys(filesMultiwordUpper).length).toEqual(48)
})

// Layout
Expand Down Expand Up @@ -369,8 +369,8 @@ describe('admin-pages/Post', () => {
})

describe('creates the correct files with the correct imports', () => {
test('returns exactly 19 files', () => {
expect(Object.keys(filesMultiwordDash).length).toEqual(19)
test('returns exactly 48 files', () => {
expect(Object.keys(filesMultiwordDash).length).toEqual(48)
})

// Layout
Expand Down Expand Up @@ -710,8 +710,8 @@ describe('admin_pages/Post', () => {
})

describe('creates the correct files with the correct imports', () => {
test('returns exactly 19 files', () => {
expect(Object.keys(filesMultiwordUnderscore).length).toEqual(19)
test('returns exactly 48 files', () => {
expect(Object.keys(filesMultiwordUnderscore).length).toEqual(48)
})

// Layout
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ describe('AdminPages/Post', () => {
})

describe('creates the correct files with the correct imports', () => {
test('returns exactly 19 files', () => {
expect(Object.keys(filesMultiwordUpper).length).toEqual(19)
test('returns exactly 48 files', () => {
expect(Object.keys(filesMultiwordUpper).length).toEqual(48)
})

// Layout
Expand Down Expand Up @@ -361,8 +361,8 @@ describe('admin-pages/Post', () => {
})

describe('creates the correct files with the correct imports', () => {
test('returns exactly 19 files', () => {
expect(Object.keys(filesMultiwordDash).length).toEqual(19)
test('returns exactly 48 files', () => {
expect(Object.keys(filesMultiwordDash).length).toEqual(48)
})

// Layout
Expand Down Expand Up @@ -694,8 +694,8 @@ describe('admin_pages/Post', () => {
})

describe('creates the correct files with the correct imports', () => {
test('returns exactly 19 files', () => {
expect(Object.keys(filesMultiwordUnderscore).length).toEqual(19)
test('returns exactly 48 files', () => {
expect(Object.keys(filesMultiwordUnderscore).length).toEqual(48)
})

// Layout
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ describe('admin/Post', () => {
})

describe('creates the correct files with the correct imports', () => {
test('returns exactly 19 files', () => {
expect(Object.keys(filesLower).length).toEqual(19)
test('returns exactly 48 files', () => {
expect(Object.keys(filesLower).length).toEqual(48)
})

// Layout
Expand Down Expand Up @@ -357,8 +357,8 @@ describe('Admin/Post', () => {
})

describe('creates the correct files with the correct imports', () => {
test('returns exactly 19 files', () => {
expect(Object.keys(filesUpper).length).toEqual(19)
test('returns exactly 48 files', () => {
expect(Object.keys(filesUpper).length).toEqual(48)
})

// Layout
Expand Down
4 changes: 2 additions & 2 deletions packages/cli/src/commands/generate/scaffold/scaffold.js
Original file line number Diff line number Diff line change
Expand Up @@ -528,7 +528,7 @@ const pageFiles = async (
const finalFolder =
(nestScaffoldByModel ? singularName + '/' : '') +
outputPageName
.replace(/(?:\.test|\.mock|\.stories)(?=\.ts)/, '')
.replace(/(?:\.test|\.mock|\.stories)(?=\.ts|\.js)/, '')
.replace(/\.[jt]sx?/, '')

const outputPath = path.join(
Expand Down Expand Up @@ -625,7 +625,7 @@ const componentFiles = async (
const finalFolder =
(nestScaffoldByModel ? singularName + '/' : '') +
outputComponentName
.replace(/(?:\.test|\.mock|\.stories)(?=\.ts)/, '')
.replace(/(?:\.test|\.mock|\.stories)(?=\.ts|\.js)/, '')
.replace(/\.[jt]sx?/, '')

const outputPath = path.join(
Expand Down

0 comments on commit a853a9f

Please sign in to comment.