hbenl / vscode-mocha-test-adapter

Mocha Test Adapter for the VS Code Test Explorer
MIT License
91 stars 31 forks source link

Arrays assertions #217

Closed vasiliyaltunin closed 2 years ago

vasiliyaltunin commented 2 years ago

I have code to test:

let db = tools.fillDB();

describe('Calendar gen test', () => {
 it('Test arr', () => {
        assert.equal([
            2, 2, 2, 8, 8, 8, 8,
            8, 5, 5, 5, 5, 5, 3,
            3, 3, 3, 3, 9, 9, 9,
            9, 9, 6, 6, 6, 6, 6,
            8, 8, 8,        
        ], db[0]);
    });

When i run test i get:

AssertionError [ERR_ASSERTION]: [
  2,
  2,
  2,
  8,
  8,
  8,
  8,
  8,
  5,
  5,
  5,
  5,
  5,
  3,
  3,
  3,
  3,
  3,
  9,
  9,
  9,
  9,
  9,
  6,
  6,
  6,
  6,
  6,
  8,
  8,
  8
] == [
  2,
  2,
  2,
  8,
  8,
  8,
  8,
  8,
  5,
  5,
  5,
  5,
  5,
  3,
  3,
  3,
  3,
  3,
  9,
  9,
  9,
  9,
  9,
  6,
  6,
  6,
  6,
  6,
  8,
  8,
  8
]

Is there a way to force it write assertion result in just two long strings so i can compare them?

hbenl commented 2 years ago

The output is created by the assert function that you're using (which is not part of this extension), you'd have to ask the authors of that function.