From 94051ba93efa65ab642fc5377054bfae658eabdb Mon Sep 17 00:00:00 2001
From: Adam <adam@haglund.dev>
Date: Sun, 17 Jul 2022 22:49:05 +0200
Subject: [PATCH] add test

---
 __tests__/installer.test.ts | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/__tests__/installer.test.ts b/__tests__/installer.test.ts
index 33579740..ea39de85 100644
--- a/__tests__/installer.test.ts
+++ b/__tests__/installer.test.ts
@@ -396,6 +396,15 @@ describe('setup-node', () => {
     }
   }, 100000);
 
+  it('enables corepack if specified', async () => {
+    inputs['corepack'] = 'true';
+
+    await main.run();
+
+    // It seems to call it with the absolute path to corepack, so we easily use `toHaveBeenCalledWith`
+    expect(cnSpy.mock.calls[2][0]).toContain('corepack enable');
+  });
+
   describe('check-latest flag', () => {
     it('use local version and dont check manifest if check-latest is not specified', async () => {
       os.platform = 'linux';