Skip to content

Commit

Permalink
fix: update failing jest test (based on the current branch name)
Browse files Browse the repository at this point in the history
  • Loading branch information
sghoweri committed Mar 22, 2019
1 parent 9a9d6b0 commit 0e05374
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions scripts/__tests__/now-url-alias.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,18 @@ describe('branch name for url aliases exists', () => {
expect(branchName).toBeDefined();
});

test('url-friendly branch name formatted correctly', async () => {
expect(branchName).toEqual(expect.not.stringContaining(' '));
expect(branchName).toEqual(expect.not.stringContaining('.'));
expect(branchName).toEqual(expect.not.stringContaining('--'));
test('url-friendly branch name URL is formatted correctly', async () => {
const result = normalizeUrlAlias(branchName);

expect(result).toEqual(expect.not.stringContaining(' '));
expect(result.replace('.boltdesignsystem.com', '')).toEqual(expect.not.stringContaining('.'));
expect(result).toEqual(expect.not.stringContaining('--'));
});

test('now.sh deploy branch alias name', async () => {
const result = normalizeUrlAlias(branchName);
const resultWithoutHttps = result.replace('https://', '');

expect(result).toContain('boltdesignsystem.com');
expect(result).toContain('boltdesignsystem.com');
expect(resultWithoutHttps.length <= 62).toEqual(true);
});
Expand Down

0 comments on commit 0e05374

Please sign in to comment.