@contrast/core 1.0.0 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contrast/core",
3
- "version": "1.0.0",
3
+ "version": "1.1.0",
4
4
  "description": "Preconfigured Contrast agent core services and models",
5
5
  "license": "SEE LICENSE IN LICENSE",
6
6
  "author": "Contrast Security <nodejs@contrastsecurity.com> (https://www.contrastsecurity.com)",
@@ -17,8 +17,8 @@
17
17
  "test": "../scripts/test.sh"
18
18
  },
19
19
  "dependencies": {
20
- "@contrast/agentify": "1.0.0",
21
- "@contrast/config": "1.0.0",
20
+ "@contrast/agentify": "1.0.1",
21
+ "@contrast/config": "1.1.0",
22
22
  "@contrast/dep-hooks": "1.0.0",
23
23
  "@contrast/logger": "1.0.0",
24
24
  "@contrast/patcher": "1.0.0",
@@ -1,75 +0,0 @@
1
- 'use strict';
2
-
3
- const { expect } = require('chai');
4
- const sinon = require('sinon');
5
- const proxyquire = require('proxyquire');
6
- const nodePath = require('path');
7
- const mockPackageJson = require('../../test/mocks/package.json');
8
-
9
- describe('core app-info', function() {
10
- let os;
11
- let path;
12
- let fs;
13
- let core;
14
- let appInfo;
15
- let pathToPackageJson;
16
-
17
- beforeEach(function() {
18
- const mocks = require('../../test/mocks');
19
- core = mocks.core();
20
- core.config = mocks.config();
21
- core.logger = mocks.logger();
22
- core.config.server.name = 'zoing';
23
-
24
- os = {
25
- type: sinon.stub().returns('Linux'),
26
- platform: sinon.stub().returns('linux'),
27
- arch: sinon.stub().returns('x64'),
28
- release: sinon.stub().returns('1.23.45'),
29
- hostname: sinon.stub().returns('hostname'),
30
- };
31
- path = {
32
- resolve: sinon.stub().callsFake(() => {
33
- pathToPackageJson = nodePath.resolve('./test/mocks/package.json');
34
- return pathToPackageJson;
35
- }),
36
- dirname: sinon.stub().callsFake(() => '/path/to'),
37
- };
38
- fs = {
39
- readdirSync: sinon.stub().callsFake(() => ['package.json']),
40
- statSync: sinon.stub(),
41
- };
42
- appInfo = proxyquire(
43
- './app-info',
44
- {
45
- fs,
46
- os,
47
- path,
48
- process: { ...process, version: 'v14.17.5' }
49
- }
50
- )(core);
51
- });
52
-
53
- it('builds out app data from os and process information', function() {
54
- expect(appInfo).eql({
55
- os: {
56
- type: 'Linux',
57
- platform: 'linux',
58
- architecture: 'x64',
59
- release: '1.23.45'
60
- },
61
- app_dir: '/path/to',
62
- hostname: 'hostname',
63
- cmd: undefined,
64
- name: 'project-name',
65
- pkg: mockPackageJson,
66
- serverVersion: undefined,
67
- node_version: 'v14.17.5',
68
- appPath: '/',
69
- path: pathToPackageJson,
70
- indexFile: undefined,
71
- serverName: 'zoing',
72
- serverEnvironment: undefined
73
- });
74
- });
75
- });
@@ -1,32 +0,0 @@
1
- 'use strict';
2
-
3
- const { expect } = require('chai');
4
-
5
- describe('core capture-stactrace', function g() {
6
- let core;
7
-
8
- beforeEach(function() {
9
- const mocks = require('../../test/mocks');
10
- core = mocks.core();
11
- core.config = mocks.config();
12
- require('./capture-stacktrace')(core);
13
- });
14
-
15
- it('appends a stack getter property', function() {
16
- const obj = { foo: 'bar' };
17
- core.captureStacktrace(obj);
18
- const desc = Object.getOwnPropertyDescriptor(obj, 'stack');
19
- expect(typeof desc.get).to.eql('function');
20
- });
21
-
22
- it('generates a stacktrace from given options', function() {
23
- (function outer() {
24
- (function inner() {
25
- const obj = {};
26
- core.captureStacktrace(obj, { constructorOpt: inner });
27
- expect(obj.stack[0]).to.have.property('method', 'outer');
28
- expect(obj.stack).to.have.lengthOf(10);
29
- })();
30
- })();
31
- });
32
- });
package/lib/index.test.js DELETED
@@ -1,3 +0,0 @@
1
- 'use strict';
2
-
3
- describe.skip('core', function () {});