-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
major(release): optimize, add tests, local gitconfig in CI
Signed-off-by: Charlike Mike Reagent <mameto2011@gmail.com>
- Loading branch information
Charlike Mike Reagent
committed
Nov 6, 2018
1 parent
c8fdc7c
commit d97be60
Showing
2 changed files
with
4 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
{"basic test":{"skip":false,"todo":false,"run":false,"isPending":false,"isRejected":false,"isFulfilled":true,"id":1,"str":"async (t) => {\n const fakeCwd = path.join(__dirname, 'fixtures', 'qq5');\n await fs.remove(fakeCwd);\n await charlike({\n project: { name: 'qq5' },\n locals: { version: '0.1.0' },\n cwd: path.join(__dirname, 'fixtures'),\n });\n const git = simpleGit(fakeCwd);\n\n await git.init();\n\n // All is the default execpt `[commit] gpgsign`,\n // because i'm using it on my machine\n const localGitConfig = dedent`[core]\n repositoryformatversion = 0\n filemode = true\n bare = false\n logallrefupdates = true\n [commit]\n gpgsign = false`;\n\n await fs.writeFile(path.join(fakeCwd, '.git', 'config'), localGitConfig);\n\n await git.add('./*');\n await git.commit('feat: initial blank release');\n await git.addTag('v0.1.0');\n\n await fs.writeFile(path.join(fakeCwd, 'foobar.txt'), 'zzzzz');\n await git.add('./*');\n await git.commit('feat: implement');\n\n await fs.writeFile(path.join(fakeCwd, 'fix.txt'), 'fixfix');\n await git.add('./*');\n await git.commit('fix: foo bar baz');\n\n await fs.writeFile(path.join(fakeCwd, 'fix2.txt'), '222xasas');\n await git.add('./*');\n await git.commit('fix: fo222222o bar baz');\n\n await fs.writeFile(path.join(fakeCwd, 'chore.txt'), 'chore');\n await git.add('./*');\n await git.commit('chore: foo bar baz');\n\n const result = await gitCommitsSince({\n name: '@tunnckocore/qq5',\n cwd: fakeCwd,\n });\n\n t.ok(result.pkg);\n t.ok(result.minor);\n t.ok(result.patch);\n t.strictEqual(result.increment, 'minor');\n t.strictEqual(result.minor.length, 1);\n t.strictEqual(result.patch.length, 2);\n t.strictEqual(result.pkg.name, '@tunnckocore/qq5');\n t.strictEqual(result.from, 'v0.1.0');\n t.strictEqual(result.to, '@');\n t.strictEqual(result.lastVersion, '0.1.0');\n t.strictEqual(result.nextVersion, '0.2.0');\n\n await git.addTag(`v${result.nextVersion}`);\n\n await fs.writeFile(path.join(fakeCwd, 'breaking.txt'), 'breaking breaking');\n await git.add('./*');\n await git.commit('feat(api): awful change\\n\\nBREAKING CHANGE: yeah!');\n\n const res = await gitCommitsSince({\n cwd: fakeCwd,\n });\n\n t.ok(res.commits);\n t.ok(Array.isArray(res.commits));\n t.strictEqual(res.commits[0].increment, 'major');\n\n await fs.remove(fakeCwd);\n}","title":"basic test"}} | ||
{"basic test":{"skip":false,"todo":false,"run":false,"isPending":false,"isRejected":false,"isFulfilled":true,"id":1,"str":"async (t) => {\n const fakeCwd = path.join(__dirname, 'fixtures', 'qq5');\n await fs.remove(fakeCwd);\n await charlike({\n project: { name: 'qq5' },\n locals: { version: '0.1.0' },\n cwd: path.join(__dirname, 'fixtures'),\n });\n const git = simpleGit(fakeCwd);\n\n await git.init();\n\n // All is the default execpt `[commit] gpgsign`,\n // because i'm using it on my machine\n const localGitConfig = dedent`[core]\n repositoryformatversion = 0\n filemode = true\n bare = false\n logallrefupdates = true\n [user]\n name = Foo Bar Baz\n email = foobar@example.com\n [commit]\n gpgsign = false`;\n\n await fs.writeFile(path.join(fakeCwd, '.git', 'config'), localGitConfig);\n\n await git.add('./*');\n await git.commit('feat: initial blank release');\n await git.addTag('v0.1.0');\n\n await fs.writeFile(path.join(fakeCwd, 'foobar.txt'), 'zzzzz');\n await git.add('./*');\n await git.commit('feat: implement');\n\n await fs.writeFile(path.join(fakeCwd, 'fix.txt'), 'fixfix');\n await git.add('./*');\n await git.commit('fix: foo bar baz');\n\n await fs.writeFile(path.join(fakeCwd, 'fix2.txt'), '222xasas');\n await git.add('./*');\n await git.commit('fix: fo222222o bar baz');\n\n await fs.writeFile(path.join(fakeCwd, 'chore.txt'), 'chore');\n await git.add('./*');\n await git.commit('chore: foo bar baz');\n\n const result = await gitCommitsSince({\n name: '@tunnckocore/qq5',\n cwd: fakeCwd,\n });\n\n t.ok(result.pkg);\n t.ok(result.minor);\n t.ok(result.patch);\n t.strictEqual(result.increment, 'minor');\n t.strictEqual(result.minor.length, 1);\n t.strictEqual(result.patch.length, 2);\n t.strictEqual(result.pkg.name, '@tunnckocore/qq5');\n t.strictEqual(result.from, 'v0.1.0');\n t.strictEqual(result.to, '@');\n t.strictEqual(result.lastVersion, '0.1.0');\n t.strictEqual(result.nextVersion, '0.2.0');\n\n await git.addTag(`v${result.nextVersion}`);\n\n await fs.writeFile(path.join(fakeCwd, 'breaking.txt'), 'breaking breaking');\n await git.add('./*');\n await git.commit('feat(api): awful change\\n\\nBREAKING CHANGE: yeah!');\n\n const res = await gitCommitsSince({\n cwd: fakeCwd,\n });\n\n t.ok(res.commits);\n t.ok(Array.isArray(res.commits));\n t.strictEqual(res.commits[0].increment, 'major');\n\n await fs.remove(fakeCwd);\n}","title":"basic test"}} |