Skip to content

Commit

Permalink
test: fix syntax & organization
Browse files Browse the repository at this point in the history
  • Loading branch information
malept authored and mahnunchik committed Sep 22, 2023
1 parent 9794031 commit c5d55a0
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions packages/publisher/github/test/github_spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,16 +105,19 @@ describe('GitHub', () => {
}).to.throw('Please set GITHUB_TOKEN in your environment to access these features');
});

it('should synthesize name without leading or trailing periods', () => {
expect(GitHub.sanitizeName('path/to/.foo.'), 'foo');
});

describe('sanitizeName', () => {
it('should remove leading and trailing periods from the basename', () => {
expect(GitHub.sanitizeName('path/to/.foo.')).to.equal('foo');
});

it('should synthesize name without multiple periods', () => {
expect(GitHub.sanitizeName('path/to/foo..bar'), 'foobar');
it('should remove multiple periods in a row', () => {
expect(GitHub.sanitizeName('path/to/foo..bar')).to.equal('foobar');
});

it('should synthesize name without non-alphanumeric characters', () => {
expect(GitHub.sanitizeName('path/to/foo%bar baz.'), 'foo-bar-baz');
it('should replace non-alphanumeric, non-hyphen characters with hyphens', () => {
expect(GitHub.sanitizeName('path/to/foo%bar baz.')).to.equal('foo-bar-baz');
});
});
});

0 comments on commit c5d55a0

Please sign in to comment.