Next up, last test case, it ('should allow strings with non-space characters'). I'm going to paste that in the it function and then we can actually set up the test case. You could have provided a bunch of different values as the argument to isRealString. We're still going to make that response variable. We're still going to call isRealString, but right here, I'm going to choose to pass in (' Andrew '), which is valid. The trim function is going to remove those spaces in the validation process:
it('should allow string with non-space characters', () => {
var res = isRealString(' Andrew ');
});
Down below we can expect that response is true, toBe(true). That's all you needed to do, we can go ahead and remove the comments since we have the actual code in place, and the last thing to do is run the test case to make sure our code actually works:
const expect = require('expect');
const {isRealString} = require('./validation');
describe('isRealString', () => {
it('should reject non-string values', () => {
var res = isRealString(98);
expect(res).toBe(false);
});
it('should reject string with only spaces', () => {
var res = isRealString(' ');
expect(res).toBe(false);
});
it('should allow string with non-space characters', () => {
var res = isRealString('D');
expect(res).toBe(true);
});
});
The npm test is going to get that done. This is going to run our test suite and right here we have our three test cases for isRealString, and all of them are passing, which is fantastic:

Now as I mentioned you could pretty much pass anything in here. The letter D would work as a valid room name or username. If I rerun the test suite with D as my string, the test case still passes. It doesn't really matter what you passed into here as long as it had a real non-space character. Now that we have this in place we are done. We're not going to make a commit just yet we're kind of halfway through a feature, we'll commit once we have a little more in place.