You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
svelte/compiler/generate/utils/__test__.js

39 lines
780 B

8 years ago
import * as assert from 'assert';
import deindent from './deindent.js';
describe( 'utils', () => {
describe( 'deindent', () => {
it( 'deindents a simple string', () => {
const deindented = deindent`
deindent me please
`;
assert.equal( deindented, `deindent me please` );
});
it( 'deindents a multiline string', () => {
const deindented = deindent`
deindent me please
and me as well
`;
assert.equal( deindented, `deindent me please\nand me as well` );
});
it( 'preserves indentation of inserted values', () => {
const insert = deindent`
line one
line two
`;
const deindented = deindent`
before
${insert}
after
`;
assert.equal( deindented, `before\n\tline one\n\tline two\nafter` );
});
});
});