02 about soda test - ranhs/soda-test GitHub Wiki

Soda-Test is a node package that is used for creating unit testing and API tests for other node projects or angular projects.
This package is combining many existing packages that are often used for creating node unit-tests. When using soda-Test, you don't need to install each of the test-package, you only install soda-test, and you get them all.
All types, methods, and decorator needed are in a single point (soda-test index file)
Soda-Test uses advanced Type-Script features like classed and decorators and are build to test Type-Script code.
The following packages (or concepts) are included in soda-Test:

  • mocha
  • jest
  • karma
  • chai
  • sinon
  • rewire
  • supertest

decorators

Decorators in type-script (similar to attributes in C#) are like tags you can put on one of the following:

  • class
  • method in a class
  • member variable in a class
  • argument in a class method
Soda-Test is using decorators to mark the test-cases, test-steps, and all you need for the test code to be simple and easy to write and understand.
Decorators are written like a method call starting with '@' follows with the decorator name, and it may or may not get arguments.
Examples:
@describe('demo')
class TestDemo {...}

@it()
addTwoNumbers(): TR {...}

@stub(User, "findById")
findStub: SinonStub

logSpy( @spy(console, 'log') console_log_spy: SinonSpy ): TR

Getting Started

Home

⚠️ **GitHub.com Fallback** ⚠️