fix(CLI): if git config user.name/email fails, use a placeholder rather than failing
This commit is contained in:
@@ -116,7 +116,7 @@ async function testInteractive(
|
||||
const lastCheck = entry[3] !== undefined;
|
||||
t.plan(lastCheck ? 6 : 5);
|
||||
|
||||
const proc = execa(`../bin/typescript-starter`, ['--noinstall'], {
|
||||
const proc = execa(`../bin/typescript-starter`, {
|
||||
cwd: join(process.cwd(), 'build'),
|
||||
env: {
|
||||
TYPESCRIPT_STARTER_REPO_URL: process.cwd()
|
||||
@@ -157,7 +157,6 @@ async function testInteractive(
|
||||
clearBuffer();
|
||||
type(`${entry[2][0]}${enter}`);
|
||||
await ms(200);
|
||||
|
||||
const search = `${entry[2][1]}.|s*global type definitions`;
|
||||
const exp = lastCheck
|
||||
? new RegExp(`${search}`) // should match
|
||||
@@ -170,8 +169,6 @@ async function testInteractive(
|
||||
await ms(200);
|
||||
checkBuffer(new RegExp(`${entry[3][1]}`));
|
||||
}
|
||||
|
||||
// TODO: validate contents?
|
||||
}
|
||||
|
||||
test('integration test 3: interactive mode, javascript library', async t => {
|
||||
|
||||
@@ -110,9 +110,12 @@ test('getGithubUsername: returns placeholder if not found', async t => {
|
||||
t.is(username, 'YOUR_USER_NAME');
|
||||
});
|
||||
|
||||
test('getUserInfo: throws generated errors', async t => {
|
||||
const error = await t.throws(getUserInfo(mockErr(1))());
|
||||
t.is(error.code, 1);
|
||||
test('getUserInfo: suppresses errors and returns undefined', async t => {
|
||||
const result = await getUserInfo(mockErr(1))();
|
||||
t.deepEqual(result, {
|
||||
gitEmail: undefined,
|
||||
gitName: undefined
|
||||
});
|
||||
});
|
||||
|
||||
test('initialCommit: throws generated errors', async t => {
|
||||
|
||||
Reference in New Issue
Block a user