Giter VIP home page Giter VIP logo

Comments (10)

pulviscriptor avatar pulviscriptor commented on May 22, 2024

Hi.
I do not have any tests, and i do not think such little project needs any. But i'm not very experienced with tests so i may be wrong.
Currently i do not plan to make any tests.

from agario-client.

henopied avatar henopied commented on May 22, 2024

Should I make a pr with tests in hopefully the near future?

from agario-client.

henopied avatar henopied commented on May 22, 2024

so far I have a basic test for the getFFAServer function:

var expect = require('chai').expect;
var agarClient = require('agario-client');
var client = new agarClient('tester');
var ping = require('ping');

describe('agarClient', function() {
    describe('#servers', function() {
        describe('#getFFAServer', function() {
            it('should find a server to connect to', function() {
                agarClient.servers.getFFAServer({region: 'EU-London'}, function(srv) { //requesting FFA server
                    expect(srv.server).to.be.a('string');
                });
            });
            it('should find a *valid* server to connect to', function() {
                agarClient.servers.getFFAServer({region: 'EU-London'}, function(srv) { //requesting FFA server
                    ping.sys.probe(srv.server, function(isAlive) {
                        expect(isAlive).to.equal(true);
                    });
                });
            });
        });
    });
});

from agario-client.

pulviscriptor avatar pulviscriptor commented on May 22, 2024

henopied,
Uhm... Tests is too hard for me. Coding is just my hobby and tests it too hard.
Maybe someday i will learn them to understand how they works, but not now.
Let's leave agario-client without tests at the current moment.

from agario-client.

henopied avatar henopied commented on May 22, 2024

If that is how you feel I am alright if there are no tests, although I do feel test would be of benefit to the project. If I make all the tests would you use them?

from agario-client.

pulviscriptor avatar pulviscriptor commented on May 22, 2024

What i'm trying to say, i don't understand tests thing for agario-client.
In example getFFAServer test. Sometimes agar.io provides non-working IP addresses, and that will cause test to fail but problem is not in agario-client.
Or if we do client.moveTo() test and client will be eaten immediately after spawn and client will be not able to moveTo() and that will be fail too, but client is working.
So because of that i don't think agario-client is good place for tests.
I may be wrong. I don't know.
If you sure that tests is good and will work, you can PR and i will accept them.

from agario-client.

henopied avatar henopied commented on May 22, 2024

When does agar provide non working ips? and for the moveto function I could test if the bot is even alive. I was also debating whether or not to make it create an ogar server for some of the in game functions.

from agario-client.

pulviscriptor avatar pulviscriptor commented on May 22, 2024
When does agar provide non working ips?

It happens sometimes in region EU-London for me in example.js. Yesterday when i was making bot for issue #22 i got non-working server once.
Currently i can not reproduce it, all servers are working at the moment.

I could test if the bot is even alive

That will solve .moveTo() for that problem. But there can be others i think.

I could test if the bot is even alive

To be honest i don't like this idea. Tests will test if ogar is compatible with client, but not agar.

I still don't like tests idea, but you can ignore me and PR and i will accept since i have no experience with tests and you do and you better know what are you doing.

from agario-client.

henopied avatar henopied commented on May 22, 2024

could the ips be checked through regex? and I do agree some things just cant be tested. Ogar may not be exactly like the official agar implementation but it could be used for testing and after all it does work with the official agar client so it should work with yours (not necessarily but it should.)

from agario-client.

pulviscriptor avatar pulviscriptor commented on May 22, 2024

In current situation you are the leader, do whatever you think need to be done. You have experience and knowledge.
*Testing IP with regex i like much better.
**I may go to sleep now.

from agario-client.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.