Skip to content

Commit

Permalink
fix: test for empty string
Browse files Browse the repository at this point in the history
  • Loading branch information
mcarvin8 committed Apr 7, 2024
1 parent 79f5ac7 commit 6134451
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions test/commands/delta/empty.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,13 @@ describe('scan commit messages without the regex and return an empty string.', (
let userEmail;

try {
userName = await git.getConfig('user.name');
userEmail = await git.getConfig('user.email');
userName = await git.getConfig('user.name').raw();
userEmail = await git.getConfig('user.email').raw();
} catch (error) {
// Ignore errors if the git config values are not set
}

if (!userName && !userEmail) {
if (userName === '' && userEmail === '') {
await git.addConfig('user.name', 'CI Bot', false, 'global');
await git.addConfig('user.email', '90224411+mcarvin8@users.noreply.github.com', false, 'global');
}
Expand Down
6 changes: 3 additions & 3 deletions test/commands/delta/unit.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,13 @@ describe('return the delta tests between git commits', () => {
let userEmail;

try {
userName = await git.getConfig('user.name');
userEmail = await git.getConfig('user.email');
userName = await git.getConfig('user.name').raw();
userEmail = await git.getConfig('user.email').raw();
} catch (error) {
// Ignore errors if the git config values are not set
}

if (!userName && !userEmail) {
if (userName === '' && userEmail === '') {
await git.addConfig('user.name', 'CI Bot', false, 'global');
await git.addConfig('user.email', '90224411+mcarvin8@users.noreply.github.com', false, 'global');
}
Expand Down
6 changes: 3 additions & 3 deletions test/commands/delta/warnings.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,13 @@ describe('confirm warnings are generated when files cannot be found in a package
let userEmail;

try {
userName = await git.getConfig('user.name');
userEmail = await git.getConfig('user.email');
userName = await git.getConfig('user.name').raw();
userEmail = await git.getConfig('user.email').raw();
} catch (error) {
// Ignore errors if the git config values are not set
}

if (!userName && !userEmail) {
if (userName === '' && userEmail === '') {
await git.addConfig('user.name', 'CI Bot', false, 'global');
await git.addConfig('user.email', '90224411+mcarvin8@users.noreply.github.com', false, 'global');
}
Expand Down

0 comments on commit 6134451

Please sign in to comment.