In this exercise, we are to import a function from a file called "string_functions"
, and it is in the same directory as the current file we’re editing. However, pointing to “./string_functions” returns an error:
"use strict";
import { capitalizeString } from "./string_functions";
capitalizeString("hello!");
// running tests
_string_functions is undefined
// tests completed
In the hint for this exercise, the solution references a different file name with the following:
"use strict";
import { capitalizeString } from "string-functions";
capitalizeString("hello!");
which still returns the following error:
// running tests
_stringFunctions is undefined
// tests completed
is my path screwed up or has this file been moved for testing this exercise?
edit: I was able to complete the exercise by using
import { capitalizeString } from "string_functions";
but this would usually be pointing to a module within the node_modules directory, right?