Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update dependencies node and generate build #117

Merged
merged 4 commits into from
Mar 19, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
"jest/no-identical-title": "error",
"jest/prefer-to-have-length": "warn",
"jest/valid-expect": "error",
"jest/no-test-callback": "off",
"jest/no-try-expect": "off",
"quotes": ["error", "single", { "avoidEscape": true }],
"semi": ["error", "always"]
}
Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
8.16.1
10.13.0
1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
language: node_js
node_js:
- '8'
- '10'
- '11'
- '12'
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ Breaking changes:
- The name used for the dynamic import should aways be the same as the name of its type or else a custom identifier must be used
- Non-nullable attributes with value null will use default value the same way undefined does
- Structure classes now have two methods to generically set and get the value of the attributes, `.get(attributeName)` and `.set(attributeName, attributeValue)`
- Minimum Node version is now 10

## 1.8.0 - 2019-09-16

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ Structure is built on top of modern JavaScript, using new features like [Proxy](

### Node

Node has only implemented all the used features at version 8, so for using Structure for a backend application you'll need Node 8 or later.
Node has only implemented all the used features at version 10, so for using Structure for a backend application you'll need Node 10 or later.

### Browser

Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
"benchmark": "^2.1.2",
"eslint": "^6.4.0",
"eslint-config-prettier": "^6.3.0",
"eslint-plugin-jest": "^22.17.0",
"jest": "^24.9.0",
"eslint-plugin-jest": "^23.8.2",
"jest": "^25.1.0",
"lerna": "^3.18.1",
"prettier": "^1.18.2"
}
Expand Down
5 changes: 4 additions & 1 deletion packages/jest-structure/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,14 @@
"scripts": {
"test": "jest"
},
"engines": {
"node": ">=10.13.0"
},
"devDependencies": {
"structure": "2.0.0-alpha.0"
},
"peerDependencies": {
"jest": "^24.0.0"
"jest": "^25.1.0"
},
"dependencies": {}
}
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ Received: age is valid"
`;

exports[`jest-structure toHaveInvalidAttribute when attribute path and error messages are passed when the attribute is the only one invalid when the expected errors are a subset of the actual errors fails 1`] = `
"- Expected name error messages
+ Received name error messages
"- Expected name error messages - 0
+ Received name error messages + 1

 Array [
 \\"\\\\\\"name\\\\\\" length must be at least 2 characters long\\",
Expand All @@ -53,8 +53,8 @@ exports[`jest-structure toHaveInvalidAttribute when attribute path and error mes
`;

exports[`jest-structure toHaveInvalidAttribute when attribute path and error messages are passed when the attribute is the only one invalid when the expected errors are a superset of the actual errors fails 1`] = `
"- Expected name error messages
+ Received name error messages
"- Expected name error messages - 1
+ Received name error messages + 0

 Array [
 \\"\\\\\\"name\\\\\\" must only contain alpha-numeric characters\\",
Expand Down Expand Up @@ -106,8 +106,8 @@ Received: is valid"
`;

exports[`jest-structure toHaveInvalidAttributes when messages are passed only for some when attribute is invalid but messages array is empty fails 1`] = `
"- Expected errors
+ Received errors
"- Expected errors - 1
+ Received errors + 4

@@ -1,8 +1,11 @@
 Array [
Expand All @@ -125,8 +125,8 @@ exports[`jest-structure toHaveInvalidAttributes when messages are passed only fo
`;

exports[`jest-structure toHaveInvalidAttributes when messages are passed only for some when there are missing attributes and messages fails 1`] = `
"- Expected errors
+ Received errors
"- Expected errors - 0
+ Received errors + 10

 Array [
 Object {
Expand Down Expand Up @@ -156,8 +156,8 @@ exports[`jest-structure toHaveInvalidAttributes when messages are passed only fo
`;

exports[`jest-structure toHaveInvalidAttributes when messages are passed only for some when there are missing attributes fails 1`] = `
"- Expected errors
+ Received errors
"- Expected errors - 0
+ Received errors + 8

@@ -2,6 +2,14 @@
 Object {
Expand All @@ -177,8 +177,8 @@ exports[`jest-structure toHaveInvalidAttributes when messages are passed only fo
`;

exports[`jest-structure toHaveInvalidAttributes when messages are passed only for some when there are missing messages fails 1`] = `
"- Expected errors
+ Received errors
"- Expected errors - 0
+ Received errors + 1

@@ -1,9 +1,10 @@
 Array [
Expand All @@ -199,8 +199,8 @@ Received: is valid"
`;

exports[`jest-structure toHaveInvalidAttributes when only paths are passed when none of the passed attributes are invalid fails 1`] = `
"- Expected errors
+ Received errors
"- Expected errors - 1
+ Received errors + 5

 Array [
 Object {
Expand All @@ -217,8 +217,8 @@ exports[`jest-structure toHaveInvalidAttributes when only paths are passed when
`;

exports[`jest-structure toHaveInvalidAttributes when only paths are passed when only some of the passed attributes are invalid fails 1`] = `
"- Expected errors
+ Received errors
"- Expected errors - 5
+ Received errors + 0

 Array [
 Object {
Expand All @@ -240,8 +240,8 @@ Received: is valid"
`;

exports[`jest-structure toHaveInvalidAttributes when paths and messages are passed when attribute is invalid but messages array is empty fails 1`] = `
"- Expected errors
+ Received errors
"- Expected errors - 1
+ Received errors + 4

 Array [
 Object {
Expand All @@ -258,8 +258,8 @@ exports[`jest-structure toHaveInvalidAttributes when paths and messages are pass
`;

exports[`jest-structure toHaveInvalidAttributes when paths and messages are passed when there are missing attributes and messages fails 1`] = `
"- Expected errors
+ Received errors
"- Expected errors - 0
+ Received errors + 9

 Array [
 Object {
Expand All @@ -283,8 +283,8 @@ exports[`jest-structure toHaveInvalidAttributes when paths and messages are pass
`;

exports[`jest-structure toHaveInvalidAttributes when paths and messages are passed when there are missing attributes fails 1`] = `
"- Expected errors
+ Received errors
"- Expected errors - 0
+ Received errors + 8

@@ -5,6 +5,14 @@
 ],
Expand All @@ -304,8 +304,8 @@ exports[`jest-structure toHaveInvalidAttributes when paths and messages are pass
`;

exports[`jest-structure toHaveInvalidAttributes when paths and messages are passed when there are missing messages fails 1`] = `
"- Expected errors
+ Received errors
"- Expected errors - 0
+ Received errors + 1

@@ -1,9 +1,10 @@
 Array [
Expand All @@ -321,8 +321,8 @@ exports[`jest-structure toHaveInvalidAttributes when paths and messages are pass
`;

exports[`jest-structure toHaveInvalidAttributes when using arrayContaining when arrayContaining has an intersection with the errors + other different errors fails 1`] = `
"- Expected errors
+ Received errors
"- Expected errors - 2
+ Received errors + 2

@@ -1,10 +1,10 @@
 Array [
Expand All @@ -340,8 +340,8 @@ exports[`jest-structure toHaveInvalidAttributes when using arrayContaining when
`;

exports[`jest-structure toHaveInvalidAttributes when using arrayContaining when arrayContaining is a superset of the errors fails 1`] = `
"- Expected errors
+ Received errors
"- Expected errors - 2
+ Received errors + 1

@@ -1,10 +1,9 @@
 Array [
Expand Down
2 changes: 1 addition & 1 deletion packages/structure/dist/structure.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions packages/structure/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"src"
],
"engines": {
"node": ">=8.16.1"
"node": ">=10.13.0"
},
"homepage": "https://structure.js.org/",
"repository": "https://github.com/talyssonoc/structure",
Expand Down Expand Up @@ -51,7 +51,7 @@
"@jest-runner/electron": "^2.0.2",
"babel-loader": "^8.0.6",
"coveralls": "^3.0.7",
"electron": "^6.0.12",
"electron": "^8.1.1",
"jest-structure": "2.0.0-alpha.0",
"webpack": "^4.41.2",
"webpack-cli": "^3.3.9"
Expand Down
12 changes: 8 additions & 4 deletions packages/structure/test/unit/creatingStructureClass.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,14 +126,18 @@ describe('creating a structure class', () => {

describe('when using dynamic attribute types', () => {
it('allows to use dynamic values', () => {
require('../fixtures/CircularUser');
require('../fixtures/CircularBook');
expect(() => {
require('../fixtures/CircularUser');
require('../fixtures/CircularBook');
}).not.toThrow();
});

describe('when using custom identifiers', () => {
it('allows to use dynamic types', () => {
require('../fixtures/CircularUserCustomIdentifier');
require('../fixtures/CircularBookCustomIdentifier');
expect(() => {
require('../fixtures/CircularUserCustomIdentifier');
require('../fixtures/CircularBookCustomIdentifier');
}).not.toThrow();
});
});

Expand Down
Loading