From 586b8758e39e80a527265625272dd590affe6b19 Mon Sep 17 00:00:00 2001 From: Myrotvorets Date: Tue, 26 Sep 2023 15:00:15 +0300 Subject: [PATCH] Improve coverage --- .eslintignore | 5 +++-- test/detectors/k8sdetector.test.mts | 9 ++++++++- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/.eslintignore b/.eslintignore index 450d07f..040cad5 100644 --- a/.eslintignore +++ b/.eslintignore @@ -1,3 +1,4 @@ -**/*.js -**/*.d.ts +**/*.cjs +**/*.mjs +**/*.d.mts node_modules/** diff --git a/test/detectors/k8sdetector.test.mts b/test/detectors/k8sdetector.test.mts index 3ddddcd..19cb2bb 100644 --- a/test/detectors/k8sdetector.test.mts +++ b/test/detectors/k8sdetector.test.mts @@ -35,7 +35,14 @@ describe('K8sDetector', function () { }); it('should return an empty resource if this is not a K8S', function () { - process.env.HOSTNAME = ''; + process.env.HOSTNAME = 'test'; + return expect(runDetector(k8sDetector, config)) + .to.eventually.be.an('object') + .and.have.deep.property('attributes', {}); + }); + + it('should return an empty resource if this is not a K8S (no hostname)', function () { + delete process.env.HOSTNAME; return expect(runDetector(k8sDetector, config)) .to.eventually.be.an('object') .and.have.deep.property('attributes', {});