Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 23 additions & 23 deletions __e2e__/__snapshots__/config.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -37,52 +37,56 @@ exports[`shows up current config without unnecessary output 1`] = `
},
"commands": [
{
"name": "bundle",
"description": "Build the bundle for the provided JavaScript entry file.",
"name": "build-android",
"description": "<<REPLACED>>",
"options": [
"<<REPLACED>>"
]
},
{
"name": "start",
"description": "Start the React Native development server.",
"name": "build-ios",
"description": "<<REPLACED>>",
"examples": [
"<<REPLACED>>"
],
"options": [
"<<REPLACED>>"
]
},
{
"name": "codegen",
"name": "bundle",
"description": "<<REPLACED>>",
"options": [
"<<REPLACED>>"
]
},
{
"name": "spm [action]",
"description": "Set up or maintain Swift Package Manager support for the iOS/macOS app. Actions: add, update, deinit, scaffold. With no action: add (or update if SPM is already set up).",
"name": "codegen",
"options": [
"<<REPLACED>>"
]
},
{
"name": "log-android",
"description": "<<REPLACED>>"
},
{
"name": "log-ios",
"description": "starts iOS device syslog tail",
"description": "<<REPLACED>>",
"options": [
"<<REPLACED>>"
]
},
{
"name": "run-ios",
"description": "builds your app and starts it on iOS simulator",
"examples": [
"<<REPLACED>>"
],
"name": "run-android",
"description": "<<REPLACED>>",
"options": [
"<<REPLACED>>"
]
},
{
"name": "build-ios",
"description": "builds your app for iOS platform",
"name": "run-ios",
"description": "<<REPLACED>>",
"examples": [
"<<REPLACED>>"
],
Expand All @@ -91,19 +95,15 @@ exports[`shows up current config without unnecessary output 1`] = `
]
},
{
"name": "log-android",
"description": "starts logkitty"
},
{
"name": "run-android",
"description": "builds your app and starts it on a connected Android emulator or device",
"name": "spm [action]",
"description": "<<REPLACED>>",
"options": [
"<<REPLACED>>"
]
},
{
"name": "build-android",
"description": "builds your app",
"name": "start",
"description": "<<REPLACED>>",
"options": [
"<<REPLACED>>"
]
Expand Down
17 changes: 11 additions & 6 deletions __e2e__/config.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,17 @@ afterAll(() => {
test('shows up current config without unnecessary output', () => {
const {stdout} = runCLI(path.join(DIR, 'TestProject'), ['config']);
const parsedStdout = JSON.parse(stdout);
// Strip unnecessary parts
parsedStdout.commands = parsedStdout.commands.map((command: any) => ({
...command,
examples: command.examples && ['<<REPLACED>>'],
options: command.options && ['<<REPLACED>>'],
}));
// Strip unnecessary parts. Commands also come from react-native itself, whose
// descriptions and registration order change between releases, so compare
// only the set of command names.
parsedStdout.commands = parsedStdout.commands
.map((command: any) => ({
...command,
description: command.description && '<<REPLACED>>',
examples: command.examples && ['<<REPLACED>>'],
options: command.options && ['<<REPLACED>>'],
}))
.sort((a: any, b: any) => a.name.localeCompare(b.name));

expect(parsedStdout.reactNativeVersion).toMatch(/^\d+\.\d+(\.\d+)?$/);
parsedStdout.reactNativeVersion = '<<REPLACED>>';
Expand Down
Loading