refactor: sort-files -> common utils
This commit is contained in:
committed by
Mrugesh Mohapatra
parent
063145fe90
commit
88de5bc602
@ -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';
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
export const challengeFiles = {
|
||||
exports.challengeFiles = {
|
||||
indexcss: {
|
||||
contents: 'some css',
|
||||
error: null,
|
@ -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;
|
||||
}
|
||||
};
|
@ -22,6 +22,5 @@ describe('sort-files', () => {
|
||||
const expected = ['indexhtml', 'indexjsx', 'indexjs', 'indexcss'];
|
||||
expect(sortedKeys).toStrictEqual(expected);
|
||||
});
|
||||
|
||||
});
|
||||
});
|
Reference in New Issue
Block a user