Skip to content

Commit

Permalink
✅ use join to assert path
Browse files Browse the repository at this point in the history
for .git-coauthors
  • Loading branch information
rkotze committed May 20, 2023
1 parent 6cf65c4 commit c448099
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
const path = require('path');
const fs = require('fs');
const { Author } = require('../author');
const { topLevelDirectory } = require('../../git-rev-parse');
const { gitAuthors, pathToCoAuthors } = require('.');

const validJsonString = `
Expand Down Expand Up @@ -58,7 +59,9 @@ test('.git-coauthors by default is in the home directory', () => {

test('.git-coauthors can be overwritten by a repo file', () => {
jest.spyOn(fs, 'existsSync').mockReturnValueOnce(true);
expect(pathToCoAuthors()).toMatch(/.+\/git-mob\/\.git-coauthors$/);
expect(pathToCoAuthors()).toEqual(
path.join(topLevelDirectory(), '.git-coauthors')
);
});

test('.git-coauthors can be overwritten by the env var', () => {
Expand Down

0 comments on commit c448099

Please sign in to comment.