diff --git a/.github/workflows/schematic.yml b/.github/workflows/schematic.yml
index 803b2e4f96547..9b558df4d596d 100644
--- a/.github/workflows/schematic.yml
+++ b/.github/workflows/schematic.yml
@@ -3,7 +3,7 @@ on:
pull_request:
jobs:
- schematics:
+ migration:
runs-on: ubuntu-latest
name: Run the latest migration
steps:
@@ -13,6 +13,17 @@ jobs:
id: info
- run: npx nx run cdk:schematics --v=${{ steps.info.outputs.root-package-major-version }}
+ unit-test:
+ strategy:
+ matrix:
+ os: [ubuntu-latest, windows-latest, macos-latest]
+ runs-on: ${{ matrix.os }}
+ steps:
+ - uses: actions/checkout@v4.2.2
+ - uses: taiga-family/ci/actions/setup/node@v1.105.0
+ - uses: taiga-family/ci/actions/run/node-info@v1.105.0
+ - run: npx jest projects/cdk/schematics/**/*.spec.ts --coverage=false
+
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
diff --git a/projects/cdk/schematics/ng-update/v4/index.ts b/projects/cdk/schematics/ng-update/v4/index.ts
index 32e7663a26551..f6af6876cb8ce 100644
--- a/projects/cdk/schematics/ng-update/v4/index.ts
+++ b/projects/cdk/schematics/ng-update/v4/index.ts
@@ -48,6 +48,7 @@ import {migrateEditor} from './steps/migrate-editor';
import {migrateImportProvidersFrom} from './steps/migrate-providers-from';
import {migrateRoot} from './steps/migrate-root';
import {replaceFunctions} from './steps/replace-functions';
+import {replaceTemplateLineEndings} from './steps/replace-template-line-endings';
import {replaceModulesWithProviders} from './steps/utils/replace-modules-with-providers';
function main(options: TuiSchema): Rule {
@@ -104,6 +105,7 @@ export function updateToV4(options: TuiSchema): Rule {
return chain([
main(options),
+ () => replaceTemplateLineEndings(),
() => {
const executionTime = getExecutionTime(t0, performance.now());
diff --git a/projects/cdk/schematics/ng-update/v4/steps/replace-template-line-endings.ts b/projects/cdk/schematics/ng-update/v4/steps/replace-template-line-endings.ts
new file mode 100644
index 0000000000000..8c3b7f259cd18
--- /dev/null
+++ b/projects/cdk/schematics/ng-update/v4/steps/replace-template-line-endings.ts
@@ -0,0 +1,14 @@
+///
Hello
\r\n'; + +const TEMPLATE_AFTER = type().startsWith('Windows') + ? '\r\nHello
\r\n' + : '\nHello
\n'; + +describe('ng-update', () => { + let host: UnitTestTree; + let runner: SchematicTestRunner; + + beforeEach(() => { + host = new UnitTestTree(new HostTree()); + runner = new SchematicTestRunner('schematics', collectionPath); + + setActiveProject(createProject(host)); + + createMainFiles(); + + saveActiveProject(); + }); + + it('should migrate badge in template', async () => { + const tree = await runner.runSchematic( + 'updateToV4', + {'skip-logs': process.env['TUI_CI'] === 'true'} as Partial