-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b444d7f
commit 8992111
Showing
7 changed files
with
84 additions
and
193 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
139 changes: 0 additions & 139 deletions
139
testing-projects/e2e/nx-gradle-catalog-e2e/tests/nx-gradle-catalog.spec.ts
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
9 changes: 0 additions & 9 deletions
9
testing-projects/e2e/nx-gradle-catalog-e2e/tsconfig.spec.json
This file was deleted.
Oops, something went wrong.
83 changes: 83 additions & 0 deletions
83
testing-projects/jnxplus-e2e/tests/nx-gradle/nx-gradle-catalog.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
import { | ||
addTmpToGitignore, | ||
createTestWorkspace, | ||
removeTmpFromGitignore, | ||
} from '@jnxplus/internal/testing'; | ||
import { | ||
checkFilesExist, | ||
readJson, | ||
runNxCommandAsync, | ||
uniq, | ||
} from '@nx/plugin/testing'; | ||
import { execSync } from 'child_process'; | ||
import { rmSync } from 'fs'; | ||
|
||
describe('nx-gradle version-catalog e2e', () => { | ||
let workspaceDirectory: string; | ||
const isCI = | ||
process.env.CI === 'true' || process.env.GITHUB_ACTIONS === 'true'; | ||
const rootProjectName = uniq('root-project-'); | ||
|
||
beforeAll(async () => { | ||
workspaceDirectory = createTestWorkspace(); | ||
|
||
// The plugin has been built and published to a local registry in the jest globalSetup | ||
// Install the plugin built with the latest source code into the test repo | ||
execSync(`npm install -D @jnxplus/nx-gradle@e2e`, { | ||
cwd: workspaceDirectory, | ||
stdio: 'inherit', | ||
env: process.env, | ||
}); | ||
|
||
await runNxCommandAsync( | ||
`generate @jnxplus/nx-gradle:init --dsl kotlin --rootProjectName ${rootProjectName} --preset spring-boot --versionManagement version-catalog`, | ||
); | ||
|
||
if (isCI) { | ||
removeTmpFromGitignore(); | ||
} | ||
}, 120000); | ||
|
||
afterAll(async () => { | ||
if (isCI) { | ||
addTmpToGitignore(); | ||
} | ||
// Cleanup the test project | ||
rmSync(workspaceDirectory, { | ||
recursive: true, | ||
force: true, | ||
}); | ||
}); | ||
|
||
it('should set NX_VERBOSE_LOGGING to true', async () => { | ||
expect(process.env['NX_VERBOSE_LOGGING']).toBe('true'); | ||
}, 120000); | ||
|
||
it('should use dsl option when initiating the workspace', async () => { | ||
// Making sure the package.json file contains the @jnxplus/nx-gradle dependency | ||
const packageJson = readJson('package.json'); | ||
expect(packageJson.devDependencies['@jnxplus/nx-gradle']).toBeTruthy(); | ||
|
||
// Making sure the nx.json file contains the @jnxplus/nx-gradle inside the plugins section | ||
const nxJson = readJson('nx.json'); | ||
expect(nxJson.plugins.includes('@jnxplus/nx-gradle')).toBeTruthy(); | ||
|
||
expect(() => | ||
checkFilesExist( | ||
'gradle/wrapper/gradle-wrapper.jar', | ||
'gradle/wrapper/gradle-wrapper.properties', | ||
'gradlew', | ||
'gradlew.bat', | ||
'gradle.properties', | ||
'settings.gradle.kts', | ||
'tools/linters/checkstyle.xml', | ||
), | ||
).not.toThrow(); | ||
}, 120000); | ||
|
||
it('shoud works', async () => { | ||
const name = uniq('app-'); | ||
|
||
await runNxCommandAsync(`generate @jnxplus/nx-gradle:app ${name}`); | ||
}, 240000); | ||
}); |