Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI Test for unformity #145

Open
benjaminapetersen opened this issue Jan 31, 2020 · 3 comments
Open

CI Test for unformity #145

benjaminapetersen opened this issue Jan 31, 2020 · 3 comments

Comments

@benjaminapetersen
Copy link

Thinking probably a mocha/chai script (or just plain ol' javascript really, no need to go crazy):

First could be something simple like

describe("monsters", function() => {
    describe('JSON consistency', function() {
        it('should follow a consistent structure', function() {
           monsters.forEach((monster) => {
              expect(monster.name).to.be.a('string');
              expect(monster.size).to.be.a('string');
              expect(monster.armor_class).to.be.a('number');
              // etc etc.
              // more valuable for complex properties.
           });
      }); 
  });
});
@benjaminapetersen
Copy link
Author

@bagelbits @ogregoire been off a bit but thinking about this one, since there are a lot of changes lately. changes are great! This would ensure they are uniform. Down side is the test has to be updated with the changes (but so long as they stay fairly simple, this is prob an upside as well).

@bagelbits
Copy link
Collaborator

I mean this would lead towards more standardized Schemas, which would also make life easier to document them in the API as well. (I could definitely use help with documenting stuff but also it's kind of on me to do it).

@brittonhayes
Copy link
Member

Just wanted to hop on this thread to say this would make it much easier for folks like me to maintain our API clients for the DnD project. Some sort of consistent schema checking is definitely a bigtime win in my book.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants