Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-lorem-component

Package Overview
Dependencies
Maintainers
1
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-lorem-component - npm Package Compare versions

Comparing version 0.5.3 to 0.6.1

7

example/client.js
/** @jsx React.DOM */
var React = require('react');
var ReactMount = require('react/lib/ReactMount');
var Lorem = require('../');
var React = require('react');
var Lorem = require('../');
ReactMount.allowFullPageRender = true;
var App = React.createClass({

@@ -10,0 +7,0 @@ render: function() {

var express = require('express');
var browserify = require('connect-browserify');
var reactify = require('reactify');
var React = require('react');
var render = require('react').renderComponentToString;

@@ -13,9 +13,7 @@ require('node-jsx').install();

entry: __dirname + '/client',
debug: true, watch: true,
debug: true, watch: true,
transforms: [reactify]
}))
.get('/', function(req, res, next) {
React.renderComponentToString(App(), function(markup) {
res.send(markup);
});
res.send(render(App()));
})

@@ -25,2 +23,2 @@ .listen(3000, function() {

});
{
"name": "react-lorem-component",
"version": "0.5.3",
"version": "0.6.1",
"description": "A component for React that renders paragraph or list item tags full of lorem ipsum text",

@@ -8,3 +8,3 @@ "main": "index.js",

"type": "git",
"url": "git://github.com/natekross/react-lorem-component"
"url": "git://github.com/martinandert/react-lorem-component"
},

@@ -19,4 +19,4 @@ "keywords": [

"author": {
"name": "Nathan Kross",
"email": "natekross@gmail.com"
"name": "Martin Andert",
"email": "mandert@gmail.com"
},

@@ -28,5 +28,5 @@ "license": "MIT",

"bugs": {
"url": "https://github.com/natekross/react-lorem-component/issues"
"url": "https://github.com/martinandert/react-lorem-component/issues"
},
"homepage": "https://github.com/natekross/react-lorem-component",
"homepage": "https://github.com/martinandert/react-lorem-component",
"dependencies": {

@@ -37,3 +37,3 @@ "seedable-random": "~0.0.1",

"peerDependencies": {
"react": "~0.8.0"
"react": "~0.9.0"
},

@@ -49,5 +49,4 @@ "devDependencies": {

"reactify": "~0.7.0",
"envify": "~0.2.0",
"react": "~0.8.0"
"react": "~0.9.0"
}
}
var assert = require('assert');
var React = require('react');
var LoremIpsum = require('./index');
var render = require('react').renderComponentToString;
assert.matches = function(actual, expected, message) {
if (!expected.test(actual)) {
assert.fail(actual, expected, message, '!~');
}
};
describe('react-lorem-component', function() {
it('transfers props', function() {
React.renderComponentToString(LoremIpsum({ className: "lorem-ipsum" }), function(markup) {
assert(/^<div [^>]*?class="lorem-ipsum"/.test(markup));
});
var markup = render(LoremIpsum({ className: "lorem-ipsum" }));
assert.matches(markup, /^<div [^>]*?class="lorem-ipsum"/);
});

@@ -14,14 +21,14 @@

it('renders lorem ipsum paragraphs wrapped in a DIV tag', function() {
var component = LoremIpsum({
var component = LoremIpsum({
count: 2,
words: ['foo'],
sentenceLowerBound: 3,
sentenceUpperBound: 3,
sentenceLowerBound: 1,
sentenceUpperBound: 1,
paragraphLowerBound: 2,
paragraphUpperBound: 2
paragraphUpperBound: 2
});
React.renderComponentToString(component, function(markup) {
assert(/^<div [^>]+><p>Foo foo foo. Foo foo foo.<\/p><p>Foo foo foo. Foo foo foo.<\/p><\/div>$/.test(markup));
});
var markup = render(component);
assert.matches(markup, /^<div [^>]+><p>Foo. Foo.<\/p><p>Foo. Foo.<\/p><\/div>$/);
});

@@ -33,6 +40,5 @@ });

var component = LoremIpsum({ count: 2, mode: 'list' });
var markup = render(component);
React.renderComponentToString(component, function(markup) {
assert(/^<ul [^>]+><li>.+<\/li><\/ul>$/.test(markup));
});
assert.matches(markup, /^<ul [^>]+><li>.+<\/li><\/ul>$/);
});

@@ -43,6 +49,5 @@

var component = LoremIpsum({ count: 2, mode: 'list', ordered: true });
var markup = render(component);
React.renderComponentToString(component, function(markup) {
assert(/^<ol [^>]+><li>.+<\/li><\/ol>$/.test(markup));
});
assert.matches(markup, /^<ol [^>]+><li>.+<\/li><\/ol>$/);
});

@@ -49,0 +54,0 @@ });

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc