Browse Source

:construction_worker: Cleanup after the test

Felix Rieseberg 7 years ago
parent
commit
997f3f31d2
1 changed files with 11 additions and 0 deletions
  1. 11 0
      spec/api-app-spec.js

+ 11 - 0
spec/api-app-spec.js

@@ -520,6 +520,17 @@ describe('app module', () => {
       }
     })
 
+    after(function (done) {
+      const protocolKey = new Winreg({
+        hive: Winreg.HKCU,
+        key: `\\Software\\Classes\\${protocol}`
+      })
+
+      // The last test leaves the registry dirty,
+      // delete the protocol key for those of us who test at home
+      protocolKey.destroy(() => done())
+    })
+
     beforeEach(() => {
       app.removeAsDefaultProtocolClient(protocol)
       app.removeAsDefaultProtocolClient(protocol, updateExe, processStartArgs)