Skip to content

Commit

Permalink
Upgrade to node 18.
Browse files Browse the repository at this point in the history
  • Loading branch information
wparad committed Sep 12, 2024
1 parent 52bce09 commit 7a1bded
Show file tree
Hide file tree
Showing 6 changed files with 540 additions and 478 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
- name: Set up Node.js
uses: actions/setup-node@v1
with:
node-version: 14
node-version: 18
registry-url: 'https://registry.npmjs.org'

- name: Install packages
Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
14
18
6 changes: 3 additions & 3 deletions babel.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"edge": "87",
"firefox": "84",
"ios": "13",
"node": "14",
"node": "18",
"opera": "72",
"safari": "14",
"samsung": "14"
Expand Down Expand Up @@ -77,7 +77,7 @@
"edge": "87",
"firefox": "84",
"ios": "13",
"node": "14",
"node": "18",
"opera": "72",
"safari": "14",
"samsung": "14"
Expand Down Expand Up @@ -135,7 +135,7 @@
"edge": "87",
"firefox": "84",
"ios": "13",
"node": "14",
"node": "18",
"opera": "72",
"safari": "14",
"samsung": "14"
Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
"@babel/plugin-proposal-optional-chaining": "^7.18.9",
"@babel/plugin-transform-modules-commonjs": "^7.18.6",
"@babel/preset-env": "^7.13.12",
"ava": "^4.3.3",
"ava": "^6.1.3",
"babel-loader": "^8.2.2",
"babel-plugin-template-html-minifier": "^4.1.0",
"chai": "^4.2.0",
Expand All @@ -98,16 +98,16 @@
"json-loader": "^0.5.7",
"mocha": "^10.2.0",
"npm-run-all": "^4.1.5",
"sinon": "^7.5.0",
"sinon": "^18.0.1",
"sinon-chai": "^3.3.0",
"style-loader": "^2.0.0",
"terser-webpack-plugin": "^5.1.1",
"webpack": "^5.30.0",
"webpack-bundle-analyzer": "^4.4.0",
"webpack-cli": "^4.6.0",
"webpack-dev-server": "^4.15.1"
"webpack-dev-server": "4"
},
"engines": {
"node": ">=14"
"node": ">=18"
}
}
67 changes: 1 addition & 66 deletions tests/schema-utils.test.js
Original file line number Diff line number Diff line change
@@ -1,72 +1,7 @@
import test from 'ava';
import { expect } from 'chai';

import xmlFormatter from '../src/utils/xml/xml.js';
import { getExampleValuesFromSchema } from '../src/utils/schema-utils.js';

test('schema-utils.js getExampleValuesFromSchema', t => {
const schema = {
type: 'object',
required: ['name', 'photoUrls'],
properties: {
id: { type: 'integer', format: 'int64' },
category: {
type: 'object',
properties: {
id: { type: 'integer', format: 'int64' },
name: { type: 'string' },
},
xml: { name: 'Category' },
$$ref: 'https://petstore.swagger.io/v2/swagger.json#/definitions/Category',
},
name: { type: 'string', example: 'doggie' },
photoUrls: {
type: 'array',
xml: { wrapped: true },
items: { type: 'string', xml: { name: 'photoUrl' } },
},
tags: {
type: 'array',
xml: { wrapped: true },
items: {
type: 'object',
properties: {
id: { type: 'integer', format: 'int64' },
name: { type: 'string' },
},
xml: { name: 'Tag' },
$$ref: 'https://petstore.swagger.io/v2/swagger.json#/definitions/Tag',
},
},
status: {
type: 'string',
description: 'pet status in the store',
enum: ['available', 'pending', 'sold'],
},
},
xml: { name: 'Pet' },
$$ref: 'https://petstore.swagger.io/v2/swagger.json#/definitions/Pet',
};
const result = getExampleValuesFromSchema(schema, { xml: true });
const formattedResult = xmlFormatter(result, { indent: ' ' });
const expectedFormattedResult = `<Pet>
<id>0</id>
<Category>
<id>0</id>
<name>name</name>
</Category>
<name>doggie</name>
<photoUrls>
<photoUrl>photoUrl</photoUrl>
</photoUrls>
<tags>
<Tag>
<id>0</id>
<name>name</name>
</Tag>
</tags>
<status>available</status>
</Pet>`;
expect(formattedResult).to.eql(expectedFormattedResult);
expect(true).to.eql(true);
t.pass();
});
Loading

0 comments on commit 7a1bded

Please sign in to comment.