Jump to content

Search the Community

Showing results for tags 'assert'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • HTML5 Game Coding
    • News
    • Game Showcase
    • Facebook Instant Games
    • Web Gaming Standards
    • Coding and Game Design
    • Paid Promotion (Buy Banner)
  • Frameworks
    • Pixi.js
    • Phaser 3
    • Phaser 2
    • Babylon.js
    • Panda 2
    • melonJS
    • Haxe JS
    • Kiwi.js
  • General
    • General Talk
    • GameMonetize
  • Business
    • Collaborations (un-paid)
    • Jobs (Hiring and Freelance)
    • Services Offered
    • Marketplace (Sell Apps, Websites, Games)

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Website URL


Twitter


Skype


Location


Interests

Found 1 result

  1. Hey, Still working on my Bomberman-clone, today I was writing the Grid component and was looking for a way to check if everything was working properly. Nothing better than tests to check if everything is correct, so I wrote a quick but useful plugin to do... tests PandaTests is a plugin for Panda.js that permits to do assertions the right way. To learn more about this plugin, read the following samples. You can download it via GitHub since I finally created a repository for my plugins: PandaTests on GitHub Installation In order to install PandaTests, simply copy this file into your <project_root>/src/plugins folder. That's all ! You'll then have to require it whenever you want to use it in your code. (see the samples) Samples Basic usage File main.js: game.module('game.main') .require('plugins.tests') .body(function () { game.createScene('Main', { init: function () { // We first instanciate a Test object. var test = new game.Test(); // Then we proceed our tests. test.assert(true == true, 'true equals true'); // Test pass test.assert(true == false, 'true equals false'); // Test fails test.assert(0 == false, '0 equals false'); // Test pass test.assert('false' == false, '"false" equals false'); // Test fails // Now we can ask for tests results. test.showResults(); /** * -- Tests results -- * - Passed tests: 2 (50%) * - Failed tests: 2 (50%) * - Total tests: 4 * -- Tests results -- **/ // We can also reset tests results. test.resetCounters(); } }); });
×
×
  • Create New...