UNPKG

particle-cli

Version:

Simple Node commandline application for working with your Particle devices and using the Particle Cloud

39 lines (34 loc) 798 B
const { expect } = require('../../test/setup'); const unindent = require('./unindent'); describe('unindent', () => { it('does not change a single line string', () => { const string = ' foo'; expect(unindent(string)).to.equal(string); }); it('removes leading and trailing newlines', () => { const string = ` foo `; expect(unindent(string)).to.equal('foo'); }); it('removes leading tabs', () => { const string = ` foo `; expect(unindent(string)).to.equal('foo'); }); it('removes leading spaces', () => { const string = ` foo `; expect(unindent(string)).to.equal('foo'); }); it('removes the same amount of indent from every line', () => { const string = ` foo bar fred `; expect(unindent(string)).to.equal('foo\n bar\nfred'); }); });