Skip to content

Commit

Permalink
Apply slug to the template app.json (#829)
Browse files Browse the repository at this point in the history
* Apply slug to the template app.json

- fix #817

* Test the app.json in a default project
  • Loading branch information
EvanBacon authored Jun 23, 2020
1 parent 24deed4 commit e3c834c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
8 changes: 8 additions & 0 deletions __tests__/index-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,17 @@ it('creates a full bare project by default', async () => {
expect(fileExists(projectName, 'node_modules')).toBeTruthy();
expect(fileExists(projectName, 'ios/')).toBeTruthy();
expect(fileExists(projectName, 'android/')).toBeTruthy();
expect(fileExists(projectName, 'app.json')).toBeTruthy();
if (process.platform === 'darwin') {
expect(fileExists(projectName, 'ios/Pods/')).toBeTruthy();
}
// Ensure the app.json is written properly
const appJsonPath = path.join(projectRoot, projectName, 'app.json');
const appJson = JSON.parse(await fs.readFile(appJsonPath, 'utf8'));
expect(appJson.name).toBe(projectName);
expect(appJson.displayName).toBe(projectName);
expect(appJson.expo.name).toBe(projectName);
expect(appJson.expo.slug).toBe(projectName);
});

describe('yes', () => {
Expand Down
1 change: 1 addition & 0 deletions src/Template.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ export async function extractAndPrepareTemplateAppAsync(projectRoot: string) {
name: projectName,
expo: {
name: projectName,
slug: projectName,
},
};

Expand Down

0 comments on commit e3c834c

Please sign in to comment.