From f1d846dabc3df1df36442998ff0403360f05657d Mon Sep 17 00:00:00 2001 From: grantbirki Date: Thu, 13 Apr 2023 22:59:58 +0100 Subject: [PATCH] move test file --- {src => __tests__}/index.test.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) rename {src => __tests__}/index.test.js (98%) diff --git a/src/index.test.js b/__tests__/index.test.js similarity index 98% rename from src/index.test.js rename to __tests__/index.test.js index 6b546f7..82ce5fa 100644 --- a/src/index.test.js +++ b/__tests__/index.test.js @@ -4,7 +4,7 @@ const cp = require('child_process') const path = require('path') const nock = require('nock') -const { Deployment } = require('./deployment') +const { Deployment } = require('../src/deployment') const fakeJwt = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiJiNjllMWIxOC1jOGFiLTRhZGQtOGYxOC03MzVlMzVjZGJhZjAiLCJzdWIiOiJyZXBvOnBhcGVyLXNwYS9taW55aTplbnZpcm9ubWVudDpQcm9kdWN0aW9uIiwiYXVkIjoiaHR0cHM6Ly9naXRodWIuY29tL3BhcGVyLXNwYSIsInJlZiI6InJlZnMvaGVhZHMvbWFpbiIsInNoYSI6ImEyODU1MWJmODdiZDk3NTFiMzdiMmM0YjM3M2MxZjU3NjFmYWM2MjYiLCJyZXBvc2l0b3J5IjoicGFwZXItc3BhL21pbnlpIiwicmVwb3NpdG9yeV9vd25lciI6InBhcGVyLXNwYSIsInJ1bl9pZCI6IjE1NDY0NTkzNjQiLCJydW5fbnVtYmVyIjoiMzQiLCJydW5fYXR0ZW1wdCI6IjIiLCJhY3RvciI6IllpTXlzdHkiLCJ3b3JrZmxvdyI6IkNJIiwiaGVhZF9yZWYiOiIiLCJiYXNlX3JlZiI6IiIsImV2ZW50X25hbWUiOiJwdXNoIiwicmVmX3R5cGUiOiJicmFuY2giLCJlbnZpcm9ubWVudCI6IlByb2R1Y3Rpb24iLCJqb2Jfd29ya2Zsb3dfcmVmIjoicGFwZXItc3BhL21pbnlpLy5naXRodWIvd29ya2Zsb3dzL2JsYW5rLnltbEByZWZzL2hlYWRzL21haW4iLCJpc3MiOiJodHRwczovL3Rva2VuLmFjdGlvbnMuZ2l0aHVidXNlcmNvbnRlbnQuY29tIiwibmJmIjoxNjM4ODI4MDI4LCJleHAiOjE2Mzg4Mjg5MjgsImlhdCI6MTYzODgyODYyOH0.1wyupfxu1HGoTyIqatYg0hIxy2-0bMO-yVlmLSMuu2w' @@ -23,7 +23,7 @@ describe('with all environment variables set', () => { }) it('executes cleanly', done => { - const ip = path.join(__dirname, './index.js') + const ip = path.join(__dirname, '../src/index.js') cp.exec(`node ${ip}`, { env: process.env }, (err, stdout) => { expect(stdout).toMatch(/::debug::all variables are set/) done() @@ -34,7 +34,7 @@ describe('with all environment variables set', () => { describe('with variables missing', () => { it('execution fails if there are missing variables', done => { delete process.env.ACTIONS_RUNTIME_URL - const ip = path.join(__dirname, './index.js') + const ip = path.join(__dirname, '../src/index.js') cp.exec(`node ${ip}`, { env: process.env }, (err, stdout) => { expect(stdout).toBe('') expect(err).toBeTruthy()