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

react-moment-proptypes

Package Overview
Dependencies
Maintainers
1
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-moment-proptypes - npm Package Compare versions

Comparing version 0.1.0 to 0.2.0

shippable.yaml

2

index.js

@@ -57,3 +57,3 @@ var moment = require('moment');

momentString : createMomentChecker(function(value) {
momentString : createMomentChecker(function isMomentString(value) {
return moment.utc(value).format() === 'Invalid date';

@@ -60,0 +60,0 @@ }),

{
"name": "react-moment-proptypes",
"version": "0.1.0",
"version": "0.2.0",
"description": "React proptype for moment module",

@@ -5,0 +5,0 @@ "keywords": [

# react-moment-proptypes
[![Build
Status](https://api.shippable.com/projects/55b07d2aedd7f2c052802265/badge?branchName=master)](https://app.shippable.com/projects/55b07d2aedd7f2c052802265/builds/latest)
A React Proptype Validator to check if passed prop is a moment.js construct

@@ -4,0 +7,0 @@

@@ -28,6 +28,9 @@ import { expect } from 'chai';

}
oldConsole.apply(console, arguments);
};
});
beforeEach(() => {
shallowRenderer = TestUtils.createRenderer();

@@ -41,2 +44,3 @@

TestClass = null;
shallowRenderer = null;

@@ -51,3 +55,3 @@ });

describe('Missing required', () => {
describe('Missing required object', () => {

@@ -58,3 +62,3 @@ before(() => {

propTypes : {
test : MomentPropTypes.momentObj.isRequired,
testRequiredObject : MomentPropTypes.momentObj.isRequired,
},

@@ -68,3 +72,3 @@ render() {

it('should have a warning for the missing moment obj', () => {
it('should have a warning for the missing moment obj', (done) => {

@@ -77,2 +81,3 @@ shallowRenderer.render(

expect(warnings.length).to.equal(1);
done();

@@ -83,3 +88,3 @@ });

describe('Missing optional', () => {
describe('Missing optional object', () => {

@@ -90,3 +95,3 @@ before(() => {

propTypes : {
test : MomentPropTypes.momentObj,
testOptionalObject : MomentPropTypes.momentObj,
},

@@ -100,3 +105,3 @@ render() {

it('should have no warnings for optinal moment obj', () => {
it('should have no warnings for optinal moment obj', (done) => {

@@ -109,2 +114,3 @@ shallowRenderer.render(

expect(warnings.length).to.equal(0);
done();

@@ -115,3 +121,3 @@ });

describe('Missing required', () => {
describe('Missing required string', () => {

@@ -122,3 +128,3 @@ before(() => {

propTypes : {
test : MomentPropTypes.momentString.isRequired,
testRequiredString : MomentPropTypes.momentString.isRequired,
},

@@ -132,3 +138,3 @@ render() {

it('should have a warning for the missing moment string', () => {
it('should have a warning for the missing moment string', (done) => {

@@ -139,6 +145,5 @@ shallowRenderer.render(

console.log('momentString', Object.keys(MomentPropTypes.momentString), MomentPropTypes.momentString.isRequired);
expect(warnings).to.be.an('array');
expect(warnings.length).to.equal(1);
done();

@@ -149,3 +154,3 @@ });

describe('Missing optional', () => {
describe('Missing optional string', () => {

@@ -156,3 +161,3 @@ before(() => {

propTypes : {
test : MomentPropTypes.momentString,
testOptionalString : MomentPropTypes.momentString,
},

@@ -166,3 +171,3 @@ render() {

it('should have no warnings for the optional moment string', () => {
it('should have no warnings for the optional moment string', (done) => {

@@ -175,2 +180,3 @@ shallowRenderer.render(

expect(warnings.length).to.equal(0);
done();

@@ -177,0 +183,0 @@ });

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