const pubsub = require('./pubsub.js);
class A{
async start( ) {
//some code
pubsub.publish('something');
}
}
module.export = A;
//testfile.js
const pubsub = require('./pubsub);
const A = require('./fileUnderTest.js');
//Inside describe and it
sinon.stub(pubsub, 'publish')
A.start( );
expect(pubsub.publish.calledOnce).to.be.true;
<!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/1999/html">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Transparent Search Box</title>
<link rel="stylesheet" href="searchbox.css">
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.6.3/css/all.css">
</head>
<body>
<div class="wrapper">
<div class="search_box">
<input type="text" placeholder="Search a word here/so`zni bu yerda izla">
<i class="fas fa-search"></i>
</div>
</div>
<div class="div"></div>
</body>
</html>
@import url('https://fonts.googleapis.com/css?family=Roboto');
*{
margin: 0;
padding: 0;
font-family: 'Roboto', sans-serif;
}
.wrapper{
background: url("images/bg.png") no-repeat center ;
width: 100%;
height: 100vh;
background-size: cover;
display: flex;
justify-content: center;
}
.search_box{
width: 50%;
position: relative;
}
.search_box input[type="text"]{
width: 100%;
padding: 20px;
padding-right: 80px;
box-sizing: border-box;
background: rgba(0,0,0,0.3);
border: 2px solid #fff;
border-radius: 10px;
font-size: 18px;
color: #fff;
outline: none;
}
.fa-search{
position: absolute;
transform: translateY(-50%);
right: 25px;
color: #fff;
font-size: 25px;
justify-content: center;
margin-top: 34px;
}
::-webkit-input-placeholder {
/ Chrome/Opera/Safari /
color: #fff;
}
::-moz-placeholder {
/ Firefox 19+ /
color: #fff;
}
:-ms-input-placeholder {
/ IE 10+ /
color: #fff;
}
@media screen and (max-width: 425px){
.search_box{
width: 95%;
}
}
.div {
width: 100%;
padding: 20px;
padding-right: 80px;
box-sizing: border-box;
background: rgba(0,0,0,0.3);
border: 2px solid #fff;
border-radius: 10px;
font-size: 18px;
color: #fff;
outline: none;
width: 100%;
padding: 20px;
padding-right: 80px;
box-sizing: border-box;
background: rgba(0,0,0,0.3);
}
Hi, I am doing a freeCodeCamp challenge. I have got a simple question but I do no understand something in the below function. why var testArr is given in the challenge but then in the function is given as arr and not as testArr? Sorry I know it might sound to simple for all of you. function nextInLine(arr, item) {
arr.push(item);
let removed = arr.shift();
return removed;
}
var testArr = [1,2,3,4,5];
console.log("Before: " + JSON.stringify(testArr));
console.log(nextInLine(testArr, 6));
console.log("After: " + JSON.stringify(testArr));
I've released the alpha version of spreadsheet files importer cli: sxi
. More details may be found on the package readme:
https://github.com/Siemienik/XToolset/blob/master/packages/xlsx-import-cli/README.md
(xlsx-import-cli is part of XToolset - set of high level api tools for XLSX files).
Any feedback welcomed, any stars loved :heart: .
Hey guys!
I am looking for a front-end developer (JS, React) in Bright Pattern. This is a San Francisco company developing an omnichannel contact center.
The task is rewriting one of the system modules in React (now it is on Google Web Toolkit).
Requirements:
You'll create a complex highload product with real usersand work in a high-performance expert engineering team, learn and improve working together. At your wish - business trips or relocation to our main office in San Francisco (L1 visa).
Direct contract with Bright Pattern (USA).
telegram for requests or questions - @o_kuzi
Hi, I'm trying to write a unit test for a class having some real-time functionality, but unable to do it. Can somebody help regarding what should be done to test the class and what behaviour can be easily tested?
class AccountService{
client;
constructor() {
this.client = new Stomp.Cleint({
brokerURL: url
})
}
async getData() {
this.client.onConnect = () => {
this.client.subscribe('/message', this.callback);
}
this.client.onStompError = () => { }
this.client.activate();
}
callback(message) {
const payload = JSON.parse(message);
pubsub.publish('accountData', payload.body);
}
}
I dont want to make a connection with the stomp server, since it is external service.
Hi good morning, I would like to have some feedback about this https://github.com/SaptakBhoumik/WebPlus
Is there something that can be done better?
thanks