question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add `test` and `expect` resources for fast and concise testing 🔧

See original GitHub issue

The following program should fail when run in CLI, however it succeeds. Moreover, the log() function doesn’t seem to be called. I assume the whole function to test is not run at all.

This is a fast and concise way to define tests, it would be great if this worked soon.

🦄 .editor
// Entering editor mode (^D to finish, ^C to cancel)
  test('hello', fun () {
    log('Hello!')

    expect(2 + 2):toBe(4)
    expect(2 + 2):toBe(20)
  })

int ask(call(get('test'),'hello',fun(call(get('log'),'Hello!'),call(get('toBe'),call(get('expect'),call(get('+'),2,2)),4),call(get('toBe'),call(get('expect'),call(get('+'),2,2)),20))))
5
🦄 

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:7

github_iconTop GitHub Comments

1reaction
czerwinskilukasz1commented, Jun 12, 2020

There is a related issue: #66

0reactions
czerwinskilukasz1commented, Jun 27, 2020

@mhagmajer Sounds great, I didn’t think of this kind of solution. Let me figure this out.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Best Practices for Creating End-to-End Tests - Datadog
Defining your test coverage; Building efficient, meaningful tests; Designing coherent and easy-to-navigate test suites; Creating notifications ...
Read more >
How to Write Test Cases: The Ultimate Guide with Examples
The best and simple way to organize your test document is by splitting it into many single useful sections. Divide the entire testing...
Read more >
Unit Testing Best Practices: 9 to Ensure You Do It Right
Do you know any unit testing best practice? In this post, you'll learn nine of them so you can get started the right...
Read more >
How to Write Test Cases for Software: Examples & Tutorial
But functional testing is just one aspect of writing a test case. Software testing should robustly challenge every aspect of the code from ......
Read more >
Software Testing: 101 Top Tips, Tricks and Strategies - Stackify
There's a process to thorough software testing, which entails writing appropriate test cases, ensuring that you're covering the right features ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found