refactor: sort-files -> common utils

This commit is contained in:
Oliver Eyton-Williams
2020-06-05 18:00:05 +02:00
committed by Mrugesh Mohapatra
parent 063145fe90
commit 88de5bc602
4 changed files with 4 additions and 5 deletions

View File

@ -14,7 +14,7 @@ import {
} from '../redux';
import { userSelector, isDonationModalOpenSelector } from '../../../redux';
import { Loader } from '../../../components/helpers';
import { sortFiles } from '../utils/sort-files';
import { sortFiles } from '../../../../../utils/sort-files';
import './editor.css';

View File

@ -1,4 +1,4 @@
export const challengeFiles = {
exports.challengeFiles = {
indexcss: {
contents: 'some css',
error: null,

View File

@ -1,4 +1,4 @@
export function sortFiles(challengeFiles) {
exports.sortFiles = function sortFiles(challengeFiles) {
const xs = Object.values(challengeFiles);
// TODO: refactor this to use an ext array ['html', 'js', 'css'] and loop over
// that.
@ -12,4 +12,4 @@ export function sortFiles(challengeFiles) {
return 0;
});
return xs;
}
};

View File

@ -22,6 +22,5 @@ describe('sort-files', () => {
const expected = ['indexhtml', 'indexjsx', 'indexjs', 'indexcss'];
expect(sortedKeys).toStrictEqual(expected);
});
});
});