mirror of
https://github.com/Noratrieb/haesli.git
synced 2026-01-14 19:55:03 +01:00
first test passes uwu
This commit is contained in:
parent
6f5fef2f23
commit
9a819bc3f4
7 changed files with 30 additions and 24 deletions
|
|
@ -6,7 +6,7 @@
|
|||
"license": "MIT",
|
||||
"scripts": {
|
||||
"fmt": "prettier -w .",
|
||||
"test": "node test-all.js"
|
||||
"test": "prettier -c . && node test-all.js"
|
||||
},
|
||||
"dependencies": {
|
||||
"@types/amqplib": "^0.8.2",
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import {connectAmqp, sleep} from './utils/utils.js';
|
||||
import { connectAmqp, sleep } from './utils/utils.js';
|
||||
|
||||
const connection = await connectAmqp();
|
||||
|
||||
|
|
@ -6,8 +6,6 @@ const channel = await connection.createChannel();
|
|||
|
||||
console.log('Successfully opened channel');
|
||||
|
||||
await sleep(100_000);
|
||||
|
||||
await channel.close();
|
||||
await connection.close();
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import {connectAmqp} from "./utils/utils.js";
|
||||
import { connectAmqp } from './utils/utils.js';
|
||||
|
||||
const connection = await connectAmqp();
|
||||
|
||||
|
|
|
|||
|
|
@ -1,17 +1,18 @@
|
|||
import {connect} from "amqplib";
|
||||
|
||||
import { connect } from 'amqplib';
|
||||
|
||||
export const sleep = (ms) => new Promise((res) => setTimeout(res, ms));
|
||||
|
||||
export const connectAmqp = async () => {
|
||||
return connect({
|
||||
protocol: 'amqp',
|
||||
hostname: 'localhost',
|
||||
port: 5672,
|
||||
username: 'admin',
|
||||
password: '',
|
||||
frameMax: 238556565673829,
|
||||
}, {
|
||||
|
||||
});
|
||||
}
|
||||
return connect(
|
||||
{
|
||||
protocol: 'amqp',
|
||||
hostname: 'localhost',
|
||||
port: 5672,
|
||||
username: 'admin',
|
||||
password: '',
|
||||
frameMax: 0,
|
||||
channelMax: 1000,
|
||||
},
|
||||
{}
|
||||
);
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue