Skip to content

Commit

Permalink
Add some suitable tests for package.json
Browse files Browse the repository at this point in the history
  • Loading branch information
BenSurgisonGDS committed Nov 25, 2022
1 parent cd8b07d commit a7ffd8c
Showing 1 changed file with 23 additions and 1 deletion.
24 changes: 23 additions & 1 deletion __tests__/spec/migrate.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const fixtureProjectDirectory = path.join(__dirname, '..', 'fixtures', 'test-v11
const cliPath = path.join(__dirname, '..', '..', 'bin', 'cli')

const pkg = {
name: 'govuk-prototype-kit',
name: 'test-prototype',
version: '11.0.0',
dependencies: {
'govuk-frontend': '^4.3.1',
Expand Down Expand Up @@ -44,6 +44,28 @@ describe('migrate test prototype', () => {
})
})

it('package.json', () => {
const pkgJson = fse.readJsonSync(path.join(projectDirectory, 'package.json'))

const { dependencies, name, scripts } = pkgJson

expect(Object.keys(dependencies)).toEqual([
'@govuk-prototype-kit/step-by-step',
'govuk-frontend',
'govuk-prototype-kit',
'jquery',
'notifications-node-client'
])

expect(scripts).toEqual({
dev: 'govuk-prototype-kit dev',
serve: 'govuk-prototype-kit serve',
start: 'govuk-prototype-kit start'
})

expect(name).toEqual('test-prototype')
})

it('routes.js', () => {
const routesFileContents = fs.readFileSync(path.join(appDirectory, 'routes.js'), 'utf8')

Expand Down

0 comments on commit a7ffd8c

Please sign in to comment.