Skip to content

Commit

Permalink
chore(core): enhance test for reverse function (#9726)
Browse files Browse the repository at this point in the history
  • Loading branch information
meeroslav committed Apr 7, 2022
1 parent b661710 commit 40bbfd9
Showing 1 changed file with 62 additions and 3 deletions.
65 changes: 62 additions & 3 deletions packages/nx/src/project-graph/operators.spec.ts
Expand Up @@ -13,7 +13,24 @@ const graph: ProjectGraph = {
lib2: { name: 'lib2', type: 'lib', data: null },
lib3: { name: 'lib3', type: 'lib', data: null },
},
externalNodes: {},
externalNodes: {
'npm:foo': {
type: 'npm',
name: 'npm:foo',
data: {
version: '~1.0.0',
packageName: 'foo',
},
},
'npm:@bar/baz': {
type: 'npm',
name: 'npm:@bar/baz',
data: {
version: '^0.0.2',
packageName: '@bar/baz',
},
},
},
dependencies: {
'app1-e2e': [
{
Expand Down Expand Up @@ -47,8 +64,19 @@ const graph: ProjectGraph = {
source: 'lib2',
target: 'lib3',
},
{
type: DependencyType.static,
source: 'lib2',
target: 'npm:foo',
},
],
lib3: [
{
type: DependencyType.static,
source: 'lib3',
target: 'npm:@bar/baz',
},
],
lib3: [],
},
};

Expand All @@ -63,7 +91,24 @@ describe('reverse', () => {
lib2: { name: 'lib2', type: 'lib', data: null },
lib3: { name: 'lib3', type: 'lib', data: null },
},
externalNodes: {},
externalNodes: {
'npm:foo': {
type: 'npm',
name: 'npm:foo',
data: {
version: '~1.0.0',
packageName: 'foo',
},
},
'npm:@bar/baz': {
type: 'npm',
name: 'npm:@bar/baz',
data: {
version: '^0.0.2',
packageName: '@bar/baz',
},
},
},
dependencies: {
app1: [
{
Expand Down Expand Up @@ -99,6 +144,20 @@ describe('reverse', () => {
target: 'lib2',
},
],
'npm:@bar/baz': [
{
type: DependencyType.static,
source: 'npm:@bar/baz',
target: 'lib3',
},
],
'npm:foo': [
{
type: DependencyType.static,
source: 'npm:foo',
target: 'lib2',
},
],
},
});
});
Expand Down

0 comments on commit 40bbfd9

Please sign in to comment.