Skip to content

Commit 9dd5539

Browse files
committed
refactor: fix e2e tests
1 parent 2d8f285 commit 9dd5539

File tree

1 file changed

+0
-77
lines changed

1 file changed

+0
-77
lines changed

e2e/nx-plugin-e2e/tests/generator-configuration.e2e.test.ts

Lines changed: 0 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -96,21 +96,6 @@ describe('nx-plugin g configuration', () => {
9696
'NX Generating @code-pushup/nx-plugin:configuration',
9797
);
9898
expect(cleanedStdout).not.toMatch(/^CREATE.*code-pushup.config.ts/m);
99-
expect(cleanedStdout).toMatch(/^UPDATE.*project.json/m);
100-
101-
const projectJson = await readFile(
102-
path.join(cwd, 'libs', project, 'project.json'),
103-
'utf8',
104-
);
105-
expect(JSON.parse(projectJson)).toStrictEqual(
106-
expect.objectContaining({
107-
targets: expect.objectContaining({
108-
'code-pushup': {
109-
executor: '@code-pushup/nx-plugin:cli',
110-
},
111-
}),
112-
}),
113-
);
11499
});
115100

116101
it('should NOT create a code-pushup.config.ts file if skipConfig is given', async () => {
@@ -137,21 +122,6 @@ describe('nx-plugin g configuration', () => {
137122
'NX Generating @code-pushup/nx-plugin:configuration',
138123
);
139124
expect(cleanedStdout).not.toMatch(/^CREATE.*code-pushup.config.ts/m);
140-
expect(cleanedStdout).toMatch(/^UPDATE.*project.json/m);
141-
142-
const projectJson = await readFile(
143-
path.join(cwd, 'libs', project, 'project.json'),
144-
'utf8',
145-
);
146-
expect(JSON.parse(projectJson)).toStrictEqual(
147-
expect.objectContaining({
148-
targets: expect.objectContaining({
149-
'code-pushup': {
150-
executor: '@code-pushup/nx-plugin:cli',
151-
},
152-
}),
153-
}),
154-
);
155125

156126
await expect(
157127
readFile(
@@ -161,53 +131,6 @@ describe('nx-plugin g configuration', () => {
161131
).rejects.toThrow('no such file or directory');
162132
});
163133

164-
it('should NOT add target to project.json if skipTarget is given', async () => {
165-
const cwd = path.join(testFileDir, 'configure-skip-target');
166-
await materializeTree(tree, cwd);
167-
168-
const { code, stdout } = await executeProcess({
169-
command: 'npx',
170-
args: [
171-
'nx',
172-
'g',
173-
'@code-pushup/nx-plugin:configuration',
174-
project,
175-
'--skipTarget',
176-
],
177-
cwd,
178-
});
179-
expect(code).toBe(0);
180-
181-
const cleanedStdout = removeColorCodes(stdout);
182-
183-
expect(cleanedStdout).toContain(
184-
'NX Generating @code-pushup/nx-plugin:configuration',
185-
);
186-
expect(cleanedStdout).toMatch(/^CREATE.*code-pushup.config.ts/m);
187-
expect(cleanedStdout).not.toMatch(/^UPDATE.*project.json/m);
188-
189-
const projectJson = await readFile(
190-
path.join(cwd, 'libs', project, 'project.json'),
191-
'utf8',
192-
);
193-
expect(JSON.parse(projectJson)).toStrictEqual(
194-
expect.objectContaining({
195-
targets: expect.not.objectContaining({
196-
'code-pushup': {
197-
executor: '@code-pushup/nx-plugin:cli',
198-
},
199-
}),
200-
}),
201-
);
202-
203-
await expect(
204-
readFile(
205-
path.join(cwd, 'libs', project, 'code-pushup.config.ts'),
206-
'utf8',
207-
),
208-
).resolves.toStrictEqual(expect.any(String));
209-
});
210-
211134
it('should inform about dry run', async () => {
212135
const cwd = path.join(testFileDir, 'configure');
213136
await materializeTree(tree, cwd);

0 commit comments

Comments
 (0)