Skip to content

Commit

Permalink
feat(common): move octal function into e2e testing utils
Browse files Browse the repository at this point in the history
  • Loading branch information
tinesoft authored Jul 3, 2022
1 parent 08d6099 commit b15a616
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 18 deletions.
7 changes: 1 addition & 6 deletions e2e/nx-micronaut-e2e/tests/nx-micronaut.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
tmpProjPath,
uniq,
} from '@nrwl/nx-plugin/testing';
import { ensureNxProjectWithDeps } from '@nxrocks/common/testing';
import { ensureNxProjectWithDeps, octal } from '@nxrocks/common/testing';

import { lstatSync } from 'fs';

Expand Down Expand Up @@ -171,9 +171,4 @@ describe('nx-micronaut e2e', () => {
expect(project.tags).toEqual(['e2etag', 'e2ePackage']);
}, 120000);
});

function octal(value: string | number): number {
if (typeof value === 'string') return parseInt(value, 8);
return value;
}
});
7 changes: 1 addition & 6 deletions e2e/nx-quarkus-e2e/tests/nx-quarkus.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
uniq,
tmpProjPath
} from '@nrwl/nx-plugin/testing';
import { ensureNxProjectWithDeps } from '@nxrocks/common/testing';
import { ensureNxProjectWithDeps, octal } from '@nxrocks/common/testing';

import { lstatSync } from 'fs';

Expand Down Expand Up @@ -165,9 +165,4 @@ describe('nx-quarkus e2e', () => {
expect(project.tags).toEqual(['e2etag', 'e2ePackage']);
}, 200000);
});

function octal(value: string | number): number {
if (typeof value === 'string') return parseInt(value, 8);
return value;
}
});
7 changes: 1 addition & 6 deletions e2e/nx-spring-boot-e2e/tests/nx-spring-boot.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
tmpProjPath
} from '@nrwl/nx-plugin/testing';
import { names } from '@nrwl/devkit';
import {ensureNxProjectWithDeps} from '@nxrocks/common/testing';
import {ensureNxProjectWithDeps, octal} from '@nxrocks/common/testing';

import { lstatSync } from 'fs';

Expand Down Expand Up @@ -171,9 +171,4 @@ describe('nx-spring-boot e2e', () => {

}, 200000);
});

function octal(value: string | number): number {
if (typeof value === 'string') return parseInt(value, 8);
return value;
}
});
6 changes: 6 additions & 0 deletions packages/common/src/lib/testing/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,9 @@ export async function* syncToAsyncIterable(syncIterable) {
yield elem;
}
}


export function octal(value: string | number): number {
if (typeof value === 'string') return parseInt(value, 8);
return value;
}

0 comments on commit b15a616

Please sign in to comment.