lev-react-components
Advanced tools
Comparing version 0.8.0 to 0.9.0
{ | ||
"name": "lev-react-components", | ||
"version": "0.8.0", | ||
"version": "0.9.0", | ||
"description": "React.js components for use in the LEV project", | ||
@@ -9,4 +9,5 @@ "main": "dist/index.js", | ||
"test": "jest", | ||
"visualise": "npm test -- -- . --visualise", | ||
"visualise": "VISUALISE=true npm test", | ||
"watch": "npm test -- --watch", | ||
"visch": "VISUALISE=true npm test -- --watch", | ||
"build": "rollup -c rollup.config.js", | ||
@@ -13,0 +14,0 @@ "prepublish": "npm run build", |
import React from 'react'; | ||
import { default as HourlyUsage, ticks, max, sort } from '../../../src/lev-report/charts/HourlyUsage'; | ||
import renderer from 'react-test-renderer'; | ||
import { renderToString } from "react-dom/server"; | ||
import visualise from '../../visualise'; | ||
@@ -31,5 +31,5 @@ const traces = [ | ||
describe('HourlyUsage', () => { | ||
describe('helper function', () => { | ||
describe('ticks', () =>{ | ||
it('should return an array of numbers', () => expect(ticks).toStrictEqual([0, 3, 6, 9, 12, 15, 18, 21, 24])); | ||
describe('helper', () => { | ||
describe('ticks', () => { | ||
it('should be an array of numbers', () => expect(ticks).toStrictEqual([0, 3, 6, 9, 12, 15, 18, 21, 24])); | ||
}); | ||
@@ -50,25 +50,7 @@ describe('max', () => { | ||
it('renders correctly', () => { | ||
const tree = renderer | ||
.create(<HourlyUsage traces={traces}/>) | ||
.toJSON(); | ||
const tree = renderer.create(<HourlyUsage traces={traces}/>).toJSON(); | ||
expect(tree).toMatchSnapshot(); | ||
}); | ||
afterAll(() => { | ||
if (process.argv.includes('--visualise')) { | ||
const html = `<html> | ||
<head> | ||
<title>Component Preview</title> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
</head> | ||
<body style="margin:0;"> | ||
<div id="app"> | ||
${renderToString(<HourlyUsage traces={traces}/>)} | ||
</div> | ||
</body> | ||
</html>`; | ||
require('fs').writeFileSync('test/lev-report/charts/__snapshots__/HourlyUsage.html', html); | ||
} | ||
}); | ||
visualise(<HourlyUsage traces={traces}/>, 'test/lev-report/charts/__snapshots__/HourlyUsage.html'); | ||
}); | ||
}); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
16285196
139123
2
21
1