From 443ee9002018e07659196ad02708e4b78607d428 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Iiro=20J=C3=A4ppinen?= Date: Sun, 7 Jul 2019 00:58:16 +0300 Subject: [PATCH] test: add test for gitStashPop throwing --- test/gitWorkflow.spec.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/test/gitWorkflow.spec.js b/test/gitWorkflow.spec.js index 155780932..586ecf18a 100644 --- a/test/gitWorkflow.spec.js +++ b/test/gitWorkflow.spec.js @@ -3,7 +3,7 @@ import path from 'path' import tmp from 'tmp' import execa from 'execa' -import { execGit } from '../src/gitWorkflow' +import { execGit, gitStashPop } from '../src/gitWorkflow' tmp.setGracefulCleanup() @@ -32,4 +32,12 @@ describe('gitWorkflow', () => { }) }) }) + + describe('gitStashPop', () => { + it('should throw when workingTree is null', () => { + expect(gitStashPop()).rejects.toThrowErrorMatchingInlineSnapshot( + `"Trying to restore from stash but could not find working copy stash."` + ) + }) + }) })