diff --git a/libs/nx/src/__fixtures__/nx-project/proj2/project.json b/libs/nx/src/__fixtures__/nx-project/proj2/project.json index a487cb9..0e1060b 100644 --- a/libs/nx/src/__fixtures__/nx-project/proj2/project.json +++ b/libs/nx/src/__fixtures__/nx-project/proj2/project.json @@ -1,3 +1,6 @@ { - "name": "proj2" + "name": "proj2", + "targets": { + "build": {} + } } diff --git a/libs/nx/src/__fixtures__/nx-project/proj3/project.json b/libs/nx/src/__fixtures__/nx-project/proj3/project.json new file mode 100644 index 0000000..482ceb7 --- /dev/null +++ b/libs/nx/src/__fixtures__/nx-project/proj3/project.json @@ -0,0 +1,8 @@ +{ + "name": "proj3", + "targets": { + "build": { + "options": {} + } + } +} diff --git a/libs/nx/src/__fixtures__/nx-project/proj4/project.json b/libs/nx/src/__fixtures__/nx-project/proj4/project.json new file mode 100644 index 0000000..f3b7eeb --- /dev/null +++ b/libs/nx/src/__fixtures__/nx-project/proj4/project.json @@ -0,0 +1,10 @@ +{ + "name": "proj4", + "targets": { + "build": { + "options": { + "tsConfig": "proj4/tsconfig.json" + } + } + } +} diff --git a/libs/nx/src/__fixtures__/nx-project/proj4/tsconfig.json b/libs/nx/src/__fixtures__/nx-project/proj4/tsconfig.json new file mode 100644 index 0000000..0967ef4 --- /dev/null +++ b/libs/nx/src/__fixtures__/nx-project/proj4/tsconfig.json @@ -0,0 +1 @@ +{} diff --git a/libs/nx/src/nx.spec.ts b/libs/nx/src/nx.spec.ts index e4b5475..25f90d9 100644 --- a/libs/nx/src/nx.spec.ts +++ b/libs/nx/src/nx.spec.ts @@ -124,7 +124,7 @@ describe('nx', () => { beforeEach(() => { jest .spyOn(globby, 'globby') - .mockResolvedValue(['./proj1/project.json', './proj2/project.json']); + .mockResolvedValue(['./proj1/project.json', './proj2/project.json', './proj3/project.json', './proj4/project.json']); }); it('should return all found nx projects', async () => { @@ -142,6 +142,31 @@ describe('nx', () => { name: 'proj2', project: { name: 'proj2', + targets: { build: {} } + }, + }), + expect.objectContaining({ + name: 'proj3', + project: { + name: 'proj3', + targets: { + build: { + options: {} + } + } + }, + }), + expect.objectContaining({ + name: 'proj4', + project: { + name: 'proj4', + targets: { + build: { + options: { + tsConfig: 'proj4/tsconfig.json' + } + } + } }, }), ])