add test for snippets

This commit is contained in:
David Lechner
2021-02-01 10:26:06 -06:00
parent 4c5adc20e7
commit 6ccb77a5ad
+21
View File
@@ -0,0 +1,21 @@
// SPDX-License-Identifier: MIT
// Copyright (c) 2021 The Pybricks Authors
import ace from 'ace-builds';
import './snippets';
type Snippets = {
snippetText: string;
scope: string;
};
it('indents with tabs', () => {
const { snippetText, scope } = ace.require('ace/snippets/python') as Snippets;
expect(scope).toBe('python');
for (const line of snippetText.split('\n')) {
expect(line).not.toMatch(/^(\t* )+\t*/);
}
});