diff --git a/packages/remix/src/generators/application/application.impl.spec.ts b/packages/remix/src/generators/application/application.impl.spec.ts index 47feaf0a0b..cc510d65b8 100644 --- a/packages/remix/src/generators/application/application.impl.spec.ts +++ b/packages/remix/src/generators/application/application.impl.spec.ts @@ -316,8 +316,10 @@ describe('Remix Application', () => { }); describe('TS solution setup', () => { - it('should add project references when using TS solution', async () => { - const tree = createTreeWithEmptyWorkspace(); + let tree: Tree; + + beforeEach(() => { + tree = createTreeWithEmptyWorkspace(); updateJson(tree, 'package.json', (json) => { json.workspaces = ['packages/*', 'apps/*']; return json; @@ -333,7 +335,9 @@ describe('Remix Application', () => { files: [], references: [], }); + }); + it('should add project references when using TS solution', async () => { await applicationGenerator(tree, { directory: 'myapp', e2eTestRunner: 'playwright', @@ -523,6 +527,20 @@ describe('Remix Application', () => { } `); }); + + it('should generate valid package.json without formatting', async () => { + await applicationGenerator(tree, { + directory: 'myapp', + e2eTestRunner: 'playwright', + unitTestRunner: 'jest', + addPlugin: true, + skipFormat: true, + }); + + expect(() => + JSON.parse(tree.read('myapp/package.json', 'utf-8')) + ).not.toThrow(); + }); }); }); diff --git a/packages/remix/src/generators/application/files/ts-solution/package.json__tmpl__ b/packages/remix/src/generators/application/files/ts-solution/package.json__tmpl__ index 06b3362f5c..594f4bd31a 100644 --- a/packages/remix/src/generators/application/files/ts-solution/package.json__tmpl__ +++ b/packages/remix/src/generators/application/files/ts-solution/package.json__tmpl__ @@ -24,8 +24,7 @@ <%_ if (name !== projectName) { _%> "name": "<%= name %>",<%_ } _%> "projectType": "application", - "sourceRoot": "<%- projectRoot %>", - <%_ if (parsedTags?.length) { _%> + "sourceRoot": "<%- projectRoot %>"<%_ if (parsedTags?.length) { _%>, "tags": <%- JSON.stringify(parsedTags) %> <%_ } _%> }<% } %>