Skip to content

Commit

Permalink
chore: Added tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ijlee2 committed Mar 10, 2023
1 parent 8487064 commit 6c1053b
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 0 deletions.
9 changes: 9 additions & 0 deletions tests/utils/blueprints/blueprint-root.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { blueprintRoot } from '../../../src/utils/blueprints.js';
import { assert, test } from '../../helpers/testing.js';

test('utils | blueprints | blueprint-root', function () {
assert.strictEqual(
blueprintRoot.endsWith('src/blueprints/ember-addon'),
true
);
});
37 changes: 37 additions & 0 deletions tests/utils/files/find-files.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import { findFiles } from '../../../src/utils/files.js';
import { codemodOptions } from '../../helpers/shared-test-setups/typescript.js';
import { assert, loadFixture, test } from '../../helpers/testing.js';

test('utils | files | find-files', function () {
const inputProject = {
addon: {
components: {
'container-query.hbs': '',
'container-query.ts': '',
},
'.gitkeep': '',
'index.ts': '',
},
app: {
components: {
'container-query.js': '',
},
},
'.eslintrc.js': '',
'.gitignore': '',
'package.json': '',
};

loadFixture(inputProject, codemodOptions);

const filePaths = findFiles('**/*.{js,ts}', {
cwd: codemodOptions.projectRoot,
});

assert.deepStrictEqual(filePaths.sort(), [
'.eslintrc.js',
'addon/components/container-query.ts',
'addon/index.ts',
'app/components/container-query.js',
]);
});

0 comments on commit 6c1053b

Please sign in to comment.