This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Person(firstName, lastName) { | |
this.firstName = firstName; | |
this.lastName = lastName; | |
} | |
// Creating a new instance of Person | |
const newPerson = new Person("john", "duo"); | |
console.log(newPerson.firstName); // Output: john | |
console.log(newPerson.lastName); // Output: duo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = { | |
testEnvironment: "node", | |
testMatch: ["**/*.test.js"], | |
reporters: ["default", "jest-junit"], | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
load("@aspect_rules_jest//jest:defs.bzl", "jest_test") | |
######Tests##### | |
jest_test( | |
name = "test_web", | |
config = "jest.config.js", | |
auto_configure_reporters = True, | |
data = glob(["src/**/*test.js"]) + [":node_modules/jest-junit"], | |
log_level = "debug", | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
########Tetst###### | |
http_archive( | |
name = "aspect_rules_jest", | |
sha256 = "abb6bed8b7b22df20d652c60d780cc23e65ffe6c56500d5a9a836a69469f7f99", | |
strip_prefix = "rules_jest-0.14.3", | |
url = "https://github.com/aspect-build/rules_jest/archive/refs/tags/v0.14.3.tar.gz", | |
) | |
#################### |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
load("@aspect_rules_js//js:defs.bzl", "js_library") | |
load("@npm//:defs.bzl", "npm_link_all_packages") | |
load("@npm//react-project-1:webpack-cli/package_json.bzl", "bin") | |
npm_link_all_packages( | |
name = "node_modules", | |
) | |
js_library( | |
name = "lib", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const path = require("path"); | |
const HtmlWebpackPlugin = require("html-webpack-plugin"); | |
const MiniCssExtractPlugin = require("mini-css-extract-plugin"); | |
module.exports = { | |
entry: "./src/index.js", | |
output: { | |
filename: "main.js", | |
path: path.resolve(__dirname, "dist"), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
react-project-1/node_modules |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
load("@npm//:defs.bzl", "npm_link_all_packages") | |
# Link all packages from the /WORKSPACE npm_translate_lock(name = "npm") and also packages from | |
# manual /WORKSPACE npm_import rules to bazel-bin/node_modules as well as the virtual store | |
# bazel-bin/node_modules/.aspect_rules_js since /pnpm-lock.yaml is the root of the pnpm workspace | |
npm_link_all_packages( | |
name = "node_modules" | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
workspace( | |
# see https://docs.bazel.build/versions/main/skylark/deploying.html#workspace | |
name = "test-workspace", | |
) | |
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") | |
http_archive( | |
name = "aspect_rules_js", | |
sha256 = "928ba25fa82cfe7983f89118677413dc74dbc5d0360fa969da07ff22a9306052", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
packages: | |
- 'react-project-1' |