-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(core): only show cloud messaging when migrating if not using cloud (
- Loading branch information
1 parent
f98ab3f
commit 024abd2
Showing
5 changed files
with
79 additions
and
13 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 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
70 changes: 70 additions & 0 deletions
70
packages/nx/src/command-line/connect/connect-to-nx-cloud.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,70 @@ | ||
import { onlyDefaultRunnerIsUsed } from './connect-to-nx-cloud'; | ||
|
||
describe('connect-to-nx-cloud', () => { | ||
describe('onlyDefaultRunnerIsUsed', () => { | ||
it('should say no if tasks runner options is undefined and nxCloudAccessToken is set', () => { | ||
expect( | ||
onlyDefaultRunnerIsUsed({ | ||
nxCloudAccessToken: 'xxx-xx-xxx', | ||
}) | ||
).toBe(false); | ||
}); | ||
|
||
it('should say yes if tasks runner options is undefined and nxCloudAccessToken is not set', () => { | ||
expect(onlyDefaultRunnerIsUsed({})).toBe(true); | ||
}); | ||
|
||
it('should say yes if tasks runner options is set to default runner', () => { | ||
expect( | ||
onlyDefaultRunnerIsUsed({ | ||
tasksRunnerOptions: { | ||
default: { | ||
runner: 'nx/tasks-runners/default', | ||
}, | ||
}, | ||
}) | ||
).toBeTruthy(); | ||
}); | ||
|
||
it('should say no if tasks runner is set to a custom runner', () => { | ||
expect( | ||
onlyDefaultRunnerIsUsed({ | ||
tasksRunnerOptions: { | ||
default: { | ||
runner: 'custom-runner', | ||
}, | ||
}, | ||
}) | ||
).toBeFalsy(); | ||
}); | ||
|
||
it('should say yes if tasks runner has options, but no runner and not using cloud', () => { | ||
expect( | ||
onlyDefaultRunnerIsUsed({ | ||
tasksRunnerOptions: { | ||
default: { | ||
options: { | ||
foo: 'bar', | ||
}, | ||
}, | ||
}, | ||
}) | ||
).toBeTruthy(); | ||
}); | ||
|
||
it('should say no if tasks runner has options, but no runner and using cloud', () => { | ||
expect( | ||
onlyDefaultRunnerIsUsed({ | ||
tasksRunnerOptions: { | ||
default: { | ||
options: { | ||
foo: 'bar', | ||
}, | ||
}, | ||
}, | ||
nxCloudAccessToken: 'xxx-xx-xxx', | ||
}) | ||
).toBeFalsy(); | ||
}); | ||
}); | ||
}); |
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 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
024abd2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
nx-dev – ./
nx-dev-git-master-nrwl.vercel.app
nx-dev-nrwl.vercel.app
nx-five.vercel.app
nx.dev