forked from fshost/xrpc
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
145 additions
and
148 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,21 @@ | ||
// | ||
import fetch from 'cross-fetch'; | ||
import { XmlRpcMessage, XmlRpcResponse } from '../src/index.js'; | ||
import fetch from "cross-fetch"; | ||
import { XmlRpcMessage, XmlRpcResponse } from "../src/index.js"; | ||
|
||
describe('Fetch and parse XML funtion', () => { | ||
test('It should fetch and parse XML', async () => { | ||
const method = 'examples.getStateName'; | ||
describe("Fetch and parse XML funtion", () => { | ||
test("It should fetch and parse XML", async () => { | ||
const method = "examples.getStateName"; | ||
const params = 23; | ||
const message = new XmlRpcMessage(method, [params]); | ||
const input = message.xml(); | ||
const URL = 'http://betty.userland.com/RPC2'; | ||
const URL = "http://betty.userland.com/RPC2"; | ||
// | ||
const res = await fetch(URL, { method: 'post', body: input }); | ||
const res = await fetch(URL, { method: "post", body: input }); | ||
const xml = await res.text(); | ||
// | ||
const response = new XmlRpcResponse(); | ||
const result = await response.parse(xml); | ||
// | ||
expect('Minnesota').toBe(result.params[0]); | ||
expect("Minnesota").toBe(result.params[0]); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
// jest.config.js | ||
|
||
export default { | ||
testEnvironment: 'node', | ||
testEnvironment: "node", | ||
|
||
transform: { | ||
'^.+\\.jsx?$': 'babel-jest' | ||
"^.+\\.jsx?$": "babel-jest", | ||
}, | ||
verbose: true | ||
verbose: true, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -44,4 +44,4 @@ | |
"eslint-plugin-standard": "^5.0.0", | ||
"jest": "^29.3.1" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
/** | ||
* @license xrpc | ||
* (c) 2016 - 2022 Leonid Zolotarev | ||
* (c) 2016 - 2024 Leonid Zolotarev | ||
* (c) 2012 - 2013 Nathan Cartwright | ||
* License: MIT | ||
*/ | ||
|
||
export { default as XmlRpcMessage } from './lib/xmlrpc-message.js'; | ||
export { default as XmlRpcResponse } from './lib/xmlrpc-response.js'; | ||
export { default as XmlRpcMessage } from "./lib/xmlrpc-message.js"; | ||
export { default as XmlRpcResponse } from "./lib/xmlrpc-response.js"; |
Oops, something went wrong.