« first day (2550 days earlier)      last day (1016 days later) » 

12:03 AM
REFRESH!
[Minesweeper] 62 Games Played. 44 Bombs Used. 8833 Moves Performed. 10 New Users
[rubberduck-vba/Rubberduck] 1 issues opened. 4 issue comments
[Zomis/Games-nodejs] 1 commits
[Zomis/Games] 1 commits
 
 
11 hours later…
11:21 AM
@SimonForsberg my condolences... axios is incredibly annoying to mock...
 
11:37 AM
@Vogel612 urrrgh.... I thought jest-mock-axios would make it super-easy but it seems like the objects for performing the request and for injecting the mock are just not the same, so it still fails with HTTP 401 (because the token I'm sending is not a real token, which is why I want to mock...)
At this point I'm considering making my own little wrapper around it that could mock the response
 
12:17 PM
You might find ts-mock-imports interesting. It allows you to mock out the whole module
 
@Vogel612 I'm not using typescript though
 
oh, yea, that would make things more challenging...
 
12:56 PM
Good morning/day everyone! Have a nice one! New week starting today
 
1:24 PM
@Vogel612 This approach seems to work better: jestjs.io/docs/mock-functions
@Marc-Andre Morning!
 
 
2 hours later…
3:14 PM
Apparently there is something I just don't get about promises and async/await in JavaScript...
I'm using await all over the place, and yet something makes it continue anyway...
 
3:25 PM
hmm .. await only gets you anywhere if you use it on a Promise.
 
I believe I am using it on all promises
 
hmm ... and what do you mean by "continue anyway"?
 
Before a request is finished to add something to the database, the method that calls this method four steps up or so continues
 
when does the request resolve is the question here...
how do you send that request?
 
await db.ddb.putItem({
    TableName: db.TABLE_NAME,
    Item: {
        PK: { S: "ws:" + event.connectionId },
        SK: { S: "ws:" + event.connectionId },
        Data: { N: Date.now().toString(10) },
        PlayerId: { S: player.id },
        PlayerName: { S: player.name },
        Picture: { S: player.picture }
    }
}).promise()
 
3:42 PM
hmm ... that seems plausible...
are you also awaiting the promise that this call is contained in?
 
yep
If an error is thrown, how is it handled then? 🤔
 
chains through the promise rejections and is thrown on the top-level await as a PromiseRejectionError
 
hey
 
4:03 PM
Has @Simon posted his weekly update?
 
@Duga Week 1818: Server uptime, 14 days. Private book club events, one. Discussions about religion while eating strawberries, one. New clothes shopped, 9. Money spent on shopping, 1579 SEK (~155 EUR/~183 USD/~229 CAD). New clothes used, none yet. Oxygen Not Included cycle, ~220. Dupes stressed, 4. Wrong gases in base, plenty. Oxygen Not Included guides read, plenty. Games uninstalled, Heroes of the Storm.
@Vogel612 May I ask for some help troubleshooting?
@Vogel612 If I do await somecall(...).promise().catch(e => console.error(e)) and an error occurs, will it then await until the error is logged before proceeding, or will it proceed before it is logged?
 
4:27 PM
@SimonForsberg Thanks for the $cad dollar inclusion :)
 
4:50 PM
@Vogel612 Oh damnit! There was one place in the call chain where I had missed an await
bloody hell
@Duga Week 1818 (bonus): Headaches from async/await in JavaScript, quite a bit.
 
[Zomis/Games-nodejs] Zomis pushed commit 2f127bda to main: More async/await
[Zomis/Games-nodejs] Zomis pushed commit c80300fe to main: Change ProjectionType of GSI to ALL
[Zomis/Games-nodejs] Zomis pushed commit 61615e8a to main: dynamodb logging on startup/shutdown
[Zomis/Games-nodejs] Zomis pushed commit 199dad19 to main: Implement auth request
 
5:10 PM
[Zomis/Games-nodejs] Zomis pushed commit 1e9dcf0e to main: Add first expect
[Zomis/Games-nodejs] Zomis pushed commit 0a2740ab to main: Add await on all socket.send calls
 
I love test-driven development when I am fully aware of the requirements.
For this project, it's very useful
At work, not so much.
Expectations passed, 1/7
Once they are passed, I need to add a shit-ton more of them
 
@SimonForsberg I don't know...
 
@SimonForsberg What's requirements?
 
5:27 PM
@skiwi At work I wonder the same.
 
You and me both
 
 
3 hours later…
8:56 PM
Just when you thought the U.S. couldn't possibly be more racist, John Oliver proves you wrong.
 

« first day (2550 days earlier)      last day (1016 days later) »