Skip to content

Commit 695bd87

Browse files
committed
clone exercise:setup and teardown
0 parents  commit 695bd87

24 files changed

+918
-0
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
node_modules/
+53
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
{
2+
"cells": [
3+
{
4+
"cell_type": "markdown",
5+
"metadata": {
6+
"editable": true
7+
},
8+
"source": [
9+
"## Instructions\n",
10+
"This exercise includes a preconfigured <b>Jasmine</b> and <b>TypeScript</b> project. The only file you should need to modify is `indexSpec.ts`. Available scripts can be found in `package.json`.\n",
11+
"\n",
12+
"Your job is to use the <b>setup/teardown</b> and organizational skills you have learned to better organize the specs. You should \n",
13+
"- Mimic the file structure of the src folder and create individual files for each module you are importing\n",
14+
"- Use **parent** and **child suites** to organize the specs so that it is clear what each pairing does and which utility it belongs to when viewing the results in the spec reporter.\n",
15+
"\n",
16+
"Once your specs are organized, use information from the **spec reporter** to track down the error that is causing one of the specs to fail and correct it.\n",
17+
"\n",
18+
"### Suggested Plan of Attack\n",
19+
"1. Create a `utilities` folder in `tests` and separate the specs onto their respective files to match the structure of the `src` folder.\n",
20+
"2. Organize each test pair into a suite with a description. Create parent suites and name accordingly for types of utilities. \n",
21+
"3 Place any data needed to run the tests into the appropriate describe blocks for scoping. \n",
22+
"4. Run the tests and locate the error.\n",
23+
"5. Fix the error in the appropriate file.\n",
24+
"6. Run tests again to ensure all tests pass.\n",
25+
"\n",
26+
"---\n",
27+
"NOTE: a popup of \"Renderer Failure: tsconfig.json\" may open when starting this project. It is safe to ignore this error. Error is due to the comments in tsconfig.json not being considered valid JSON; however, it is generally considered safe to place comments in JSON config files."
28+
]
29+
}
30+
],
31+
"metadata": {
32+
"kernelspec": {
33+
"display_name": "Python 3",
34+
"language": "python",
35+
"name": "python3"
36+
},
37+
"language_info": {
38+
"codemirror_mode": {
39+
"name": "ipython",
40+
"version": 3
41+
},
42+
"file_extension": ".py",
43+
"mimetype": "text/x-python",
44+
"name": "python",
45+
"nbconvert_exporter": "python",
46+
"pygments_lexer": "ipython3",
47+
"version": "3.6.3"
48+
},
49+
"ulab_nb_type": "guided"
50+
},
51+
"nbformat": 4,
52+
"nbformat_minor": 4
53+
}
+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"name": "jasmine-exercise",
3+
"version": "1.0.0",
4+
"description": "Jasmine Exercise",
5+
"main": "index.js",
6+
"scripts": {
7+
"jasmine": "jasmine",
8+
"build": "npx tsc",
9+
"test": "npm run build && npm run jasmine"
10+
},
11+
"author": "Udacity",
12+
"license": "ISC",
13+
"devDependencies": {
14+
"@types/jasmine": "^3.6.3",
15+
"@types/node": "^14.14.6",
16+
"ts-node": "^9.0.0",
17+
"typescript": "^4.0.5"
18+
},
19+
"dependencies": {
20+
"jasmine": "^3.6.4",
21+
"jasmine-spec-reporter": "^6.0.0"
22+
}
23+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
{
2+
"compilerOptions": {
3+
/* Visit https://aka.ms/tsconfig.json to read more about this file */
4+
5+
/* Basic Options */
6+
// "incremental": true, /* Enable incremental compilation */
7+
"target": "es5", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019', 'ES2020', or 'ESNEXT'. */
8+
"module": "commonjs", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', 'es2020', or 'ESNext'. */
9+
"lib": ["ES6"], /* Specify library files to be included in the compilation. */
10+
"allowJs": true, /* Allow javascript files to be compiled. */
11+
//"resolveJsonModule": true,
12+
// "checkJs": true, /* Report errors in .js files. */
13+
// "jsx": "preserve", /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */
14+
// "declaration": true, /* Generates corresponding '.d.ts' file. */
15+
// "declarationMap": true, /* Generates a sourcemap for each corresponding '.d.ts' file. */
16+
// "sourceMap": true, /* Generates corresponding '.map' file. */
17+
// "outFile": "./", /* Concatenate and emit output to single file. */
18+
"outDir": "./dist", /* Redirect output structure to the directory. */
19+
// "rootDir": "./", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */
20+
// "composite": true, /* Enable project compilation */
21+
// "tsBuildInfoFile": "./", /* Specify file to store incremental compilation information */
22+
// "removeComments": true, /* Do not emit comments to output. */
23+
// "noEmit": true, /* Do not emit outputs. */
24+
// "importHelpers": true, /* Import emit helpers from 'tslib'. */
25+
// "downlevelIteration": true, /* Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'. */
26+
// "isolatedModules": true, /* Transpile each file as a separate module (similar to 'ts.transpileModule'). */
27+
28+
/* Strict Type-Checking Options */
29+
"strict": true, /* Enable all strict type-checking options. */
30+
"noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */
31+
// "strictNullChecks": true, /* Enable strict null checks. */
32+
// "strictFunctionTypes": true, /* Enable strict checking of function types. */
33+
// "strictBindCallApply": true, /* Enable strict 'bind', 'call', and 'apply' methods on functions. */
34+
// "strictPropertyInitialization": true, /* Enable strict checking of property initialization in classes. */
35+
// "noImplicitThis": true, /* Raise error on 'this' expressions with an implied 'any' type. */
36+
// "alwaysStrict": true, /* Parse in strict mode and emit "use strict" for each source file. */
37+
38+
/* Additional Checks */
39+
// "noUnusedLocals": true, /* Report errors on unused locals. */
40+
// "noUnusedParameters": true, /* Report errors on unused parameters. */
41+
// "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */
42+
// "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */
43+
44+
/* Module Resolution Options */
45+
// "moduleResolution": "node", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */
46+
// "baseUrl": "./", /* Base directory to resolve non-absolute module names. */
47+
// "paths": {}, /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */
48+
// "rootDirs": [], /* List of root folders whose combined content represents the structure of the project at runtime. */
49+
// "typeRoots": [], /* List of folders to include type definitions from. */
50+
// "types": [], /* Type declaration files to be included in compilation. */
51+
// "allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */
52+
"esModuleInterop": true, /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */
53+
// "preserveSymlinks": true, /* Do not resolve the real path of symlinks. */
54+
// "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */
55+
56+
/* Source Map Options */
57+
// "sourceRoot": "", /* Specify the location where debugger should locate TypeScript files instead of source locations. */
58+
// "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */
59+
// "inlineSourceMap": true, /* Emit a single file with source maps instead of having a separate file. */
60+
// "inlineSources": true, /* Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set. */
61+
62+
/* Experimental Options */
63+
// "experimentalDecorators": true, /* Enables experimental support for ES7 decorators. */
64+
// "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */
65+
66+
/* Advanced Options */
67+
"skipLibCheck": true, /* Skip type checking of declaration files. */
68+
"forceConsistentCasingInFileNames": true /* Disallow inconsistently-cased references to the same file. */
69+
},
70+
"exclude": ["node_modules", "./dist", "spec"]
71+
}

.tempfile

Whitespace-only changes.

.workspace-config.json

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"termTheme":"dark","layouts":{"layout-1":{"data":{"layout-restorer:data":{"main":{"dock":{"type":"split-area","orientation":"horizontal","children":[{"type":"tab-area","widgets":["notebook:Guide.ipynb"],"currentIndex":0},{"type":"split-area","orientation":"vertical","children":[{"type":"tab-area","widgets":["editor:src/tests/indexSpec.ts"],"currentIndex":0},{"type":"tab-area","widgets":["terminal:1"],"currentIndex":0}],"sizes":[0.4232329197272795,0.5767670802727205]}],"sizes":[0.38744827586206904,0.612551724137931]}}}}}}}

Guide.ipynb

+53
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
{
2+
"cells": [
3+
{
4+
"cell_type": "markdown",
5+
"metadata": {
6+
"editable": true
7+
},
8+
"source": [
9+
"## Instructions\n",
10+
"This exercise includes a preconfigured <b>Jasmine</b> and <b>TypeScript</b> project. The only file you should need to modify is `indexSpec.ts`. Available scripts can be found in `package.json`.\n",
11+
"\n",
12+
"Your job is to use the <b>setup/teardown</b> and organizational skills you have learned to better organize the specs. You should \n",
13+
"- Mimic the file structure of the src folder and create individual files for each module you are importing\n",
14+
"- Use **parent** and **child suites** to organize the specs so that it is clear what each pairing does and which utility it belongs to when viewing the results in the spec reporter.\n",
15+
"\n",
16+
"Once your specs are organized, use information from the **spec reporter** to track down the error that is causing one of the specs to fail and correct it.\n",
17+
"\n",
18+
"### Suggested Plan of Attack\n",
19+
"1. Create a `utilities` folder in `tests` and separate the specs onto their respective files to match the structure of the `src` folder.\n",
20+
"2. Organize each test pair into a suite with a description. Create parent suites and name accordingly for types of utilities. \n",
21+
"3 Place any data needed to run the tests into the appropriate describe blocks for scoping. \n",
22+
"4. Run the tests and locate the error.\n",
23+
"5. Fix the error in the appropriate file.\n",
24+
"6. Run tests again to ensure all tests pass.\n",
25+
"\n",
26+
"---\n",
27+
"NOTE: a popup of \"Renderer Failure: tsconfig.json\" may open when starting this project. It is safe to ignore this error. Error is due to the comments in tsconfig.json not being considered valid JSON; however, it is generally considered safe to place comments in JSON config files."
28+
]
29+
}
30+
],
31+
"metadata": {
32+
"kernelspec": {
33+
"display_name": "Python 3",
34+
"language": "python",
35+
"name": "python3"
36+
},
37+
"language_info": {
38+
"codemirror_mode": {
39+
"name": "ipython",
40+
"version": 3
41+
},
42+
"file_extension": ".py",
43+
"mimetype": "text/x-python",
44+
"name": "python",
45+
"nbconvert_exporter": "python",
46+
"pygments_lexer": "ipython3",
47+
"version": "3.6.3"
48+
},
49+
"ulab_nb_type": "guided"
50+
},
51+
"nbformat": 4,
52+
"nbformat_minor": 4
53+
}

0 commit comments

Comments
 (0)