From af70cf95d9d010f27da1c1c8987c807ee3255a10 Mon Sep 17 00:00:00 2001 From: HO-COOH <42881734+HO-COOH@users.noreply.github.com> Date: Sat, 15 May 2021 00:14:36 +0800 Subject: Refactor, add {file} template (#221) * Refactor, add {file} template * Add test for {file} expansion --- src/test/CppTests/Config.test.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/test/CppTests/Config.test.ts') diff --git a/src/test/CppTests/Config.test.ts b/src/test/CppTests/Config.test.ts index 1afbef3..f6ec573 100644 --- a/src/test/CppTests/Config.test.ts +++ b/src/test/CppTests/Config.test.ts @@ -11,6 +11,7 @@ import * as assert from "assert"; import * as moment from "moment"; import * as vscode from "vscode"; import { Config } from "../../Config"; +import GitConfig from "../../GitConfig"; import TestSetup from "./TestSetup"; // Defines a Mocha test suite to group tests of similar kind together @@ -242,11 +243,12 @@ suite("C++ - Configuration Tests", () => { "@author {author}", "@date {date}", "@note {email}", + "@file {file}", ]; - testSetup.cfg.Generic.useGitUserName = true; - testSetup.cfg.Generic.useGitUserEmail = true; const result = testSetup.SetLine("void foo();").GetResult(); - assert.notStrictEqual(result, "/**\n * @author {author}\n * @date {date}\n * @note {email}\n */"); + const date = moment().format("YYYY-MM-DD"); + assert.strictEqual(result, `/**\n * @author your name\n * @date ${date}\n * @note you@domain.com\n` + + ` * @file MockDocument.h\n */`); }); test("Env variable", () => { -- cgit v1.2.3